Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I need to implement a domain-specific user interaction on a plot I am building.

The user needs to be able to measure the "distance" between two points.

For that, I need the user to be able to manually trace a segment between two points on the plot (not limited to actual lines, the points can be anywhere).

Is there a way to implement that user interaction with mosaic at the moment?

I feel like this is currently not part of the specs.

If it's not possible to represent that symbolically in the specs, it means that this should be implemented with custom JavaScript (D3.js probably?). Is there any guideline / example for how to extend a mosaic plot with custom D3.js code?

Thanks ❤️

You must be logged in to vote

Replies: 2 comments

Comment options

I don't understand the user interaction you are looking for but to implement custom clients, you can look at these docs: https://idl.uw.edu/mosaic/web-clients/.

You must be logged in to vote
0 replies
Comment options

My understanding is that you'd like users to be able to:

  1. Draw out an interval between two points (a, b) along an axis
  2. Display the distance between the points in data units ((b - a) or a date diff)

I don't think this is achievable with the current declarative specs. You could create a param and bind an interval selection to it to capture a user selected interval, but there's no way to then calculate the distance between interval end points within the spec.

However, if you are using the JS API (not a YAML or JSON spec) there should be some relatively simple things you could do:

  • Listen to changes to the interval "span" param and update two other params (one for each endpoint) that then drive updates to other Mosaic plots, or
  • Add your own web component that simply listens to changes on the interval span param and updates the displayed distance. I don't think any other integration with the Mosaic architecture would be needed.
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.