Several questions about @thi.ng/viz
#480
-
Heya :) Once again strolling through the repository I found I have three unrelated questions: 1. I'd like to create multiple scatterplots below each other that share the same x-axis (time-of day); the y-position is determined by the date. This what I do with the data to prepare it (timestamp is an RFC3339 timestamp like const data = [...iterator(
comp(
map((x) => ({ ...x, datetime: new Date(x.timestamp) })),
partitionBy((x) => x.timestamp.split('T')[0])
),
measurements
)] Is this currently possible? 2. Is there any way to dynamically generate attribs, or, if I may dream, add interactivity to individual atoms of the plot? From what I can tell attribs are generated like so: scatterPlot(values, {
// static, will be the same for the entire plot
attribs: { stroke: "green", fill: "transparent", shape: "circle", size: 2, title: 'foo' },
}) Naively replacing 3. Lastly and least importantly for me: Is it possible to overlay plots with different domains? The examples show overlayed plots of different types, but they share the same domain. My guess is that it's not trivial due to the way axes work. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey @heyarne! Welcome back! 👋 These are great questions & I will try to answer them (incl. via a new example) over the weekend... In the meantime, it would really help me if you could briefly explain some more what you mean with:
Thanks & will report back asap! |
Beta Was this translation helpful? Give feedback.
-
Thank you for these, @heyarne — I will take a look at this in a bit. Just wanted to let you know I've also just uploaded a new example for you, more details in this Mastodon thread: https://mastodon.thi.ng/@toxi/112778569932971617 More to come! :) |
Beta Was this translation helpful? Give feedback.
-
Hi @heyarne, just another quick interim update by way of another new example: Demo: (move the mouse over the plots to show & update value labels) Source: Please note: This uses a still unreleased updated version of thi.ng/viz (the |
Beta Was this translation helpful? Give feedback.
Hi @heyarne, just another quick interim update by way of another new example:
Demo:
https://demo.thi.ng/umbrella/viz-ridge-lines/
(move the mouse over the plots to show & update value labels)
Source:
https://github.com/thi-ng/umbrella/tree/develop/examples/viz-ridge-lines/src/index.ts
Please note: This uses a still unreleased updated version of thi.ng/viz (the
areaPlot()
fn needed some minor update). I've already committed the changes, but release will only be sometime tomorrow/Tuesday... (more answer then too, but I hope this helps somewhat for now...)