-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new sparkbar examples and changes to allow bar only highlights #45
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
PR Summary
The above PR updated various segments of the code primarily to incorporate the 'Sparkbar' feature effectively into the application. These changes should contribute to a more robust and user-friendly interface overall. |
… yDomain for tooltip examples
@mattlangeman I'm not against adding a new CleanShot.2023-09-25.at.21.32.03.mp4I used this approach to highlight some multi-line (and area) examples. See this post and follow up replies for a few examples. With that said, I'm not against adding the tweening bar/rect shape. We could maybe support this using Thoughts? |
I actually first started looking into just changing the color of the bar directly. I didn't like duplicating the padding, stroke and radius. But I didn't come up with the You're thinking Is there an example of the snapToData functionality somewhere? I found this note in the changelog, but it looks like at one point svelte-ux and layerchart were maybe in the same repo and now the release and commits have changed?
|
That's what I was thinking, just to keep from having 2 props (
I think that might be an overlook when I generated the initial changelog from commits (before I started using changesets). If you notice, the actual commit is in the layerchart repo. Examples of the prop are available on the Tooltip component page, with the Scatter example having it enabled by default. |
Another thought I had was to use a clipPath to "mask" the I'm fine with leaving this PR as is for now, unless you want to explore some more. I wish it didn't result in some duplication/added complexity within We could also extract a I'm thinking we could also remove the I have to say |
Ah. I see now. I was looking for code within the examples directory instead of across all docs. So snapToData in these examples is to fix the position of the Tooltip instead of having it move a bit based on cursor. That makes sense to me. I'd lean towards keeping the terminology different bar highlighting. The other thing I was thinking this morning is that it would be nice to allow both current area highlights and bar highlights at the same time. This could still be accomplished with only the I'm not in a hurry to get this PR merged in and wouldn't mind exploring a bit more. I have a busy day today, but plan to revisit tomorrow. |
@mattlangeman Sounds great, and I'm not in a rush either :). I'd rather refine and iterate, with the best abstraction to support the most use cases, with simplest implementation to simplify maintenance / additional use cases (you know, the holy grail).
With TooltipContext / Tooltip, there are basically 3 ways to position:
One thing to note, is you can have multiple instances of both Also, the order you order the components matters (last one is on top, as it's <Points>
<Highlight area /> ...would put the <Highlight area />
<Points> would put the Sorry, this was as longer reply than I intended :). One focus I hope to accomplishing before tagging the 1.0 release is to punch up the documentation a lot, trying to document and describe a lot of this "hidden" functionality/capability. I'm also hoping as more users are using the library, it will naturally improve the docs. Lastly, if you'd ever want to jump on a video chat to discuss anything, I'd be open for it. |
I was playing around with the bar highlighting again today. I tried sending in the tooltip to the Bar component so that it could be used to create the highlight within Bar. That allowed for creating the tweened bar, but without duplication of radius, stroke, etc. However, I realized that you may actually want to change the stroke for the highlight bar, and that led me back to thinking it may be best to create the rect within Highlight with the different modes. The other idea was pulling in the context of Bar into Highlight via setContext and getContent and using that as defaults when creating the rect in Highlight. It would be great to have a video call sometime. My schedule can be sporadic, but has also has some flexibility. Usually my ideal times are between 10am-4pm Eastern or in the evening after 8:30pm. One topic I'm curious about is dealing with missing data and multiple datasets/different sources of data. A recent project had a unique challenges around those areas. |
Evenings typically work best for me, as I too have a sporadic schedule (between work and 3 young kids/activities). I've setup a discord server if you want to chat (invite link), and we can figure out the details when/how to do a video chat (google meet, zoom, teams, etc). I'm actually off tomorrow and could chat during the day if you'd prefer. Just let me know. |
Here are some Sparkbar examples. I ran into the situation of the current "area" Highlights not working well for Sparkbars, so I added "bar" highlights. Open to feedback on how this was implemented.