Skip to content
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

Chart improvements #183

Open
16 of 20 tasks
techniq opened this issue Jun 5, 2024 · 3 comments
Open
16 of 20 tasks

Chart improvements #183

techniq opened this issue Jun 5, 2024 · 3 comments
Milestone

Comments

@techniq
Copy link
Owner

techniq commented Jun 5, 2024

  • Chart
    • baseline support
      • Value guaranteed to be visible in domain (x/y). Useful with optional negative values since xDomain={[0, null]} would ignore negative values
    • TransformContext integration
    • GeoContext integration
    • TooltipContext integration
    • Add chartContext() with better types
    • Add radial at Chart context level instead of individual components (see RadialLine examples)
    • Better group/stack integration
    • Dedicated cScale color scale instead of using rScale (which is also useful for radius, etc)
      • Integrate with <Legend>
    • Bounds integration
      • Modify xScale/yScale along with using motionScale with tweening
      • Useful with Brush (integration)
    • Improved accessor (using LayerChart's accessor)
    • Improved types
    • Simplify Chart/LayerCake/ChartContext which enables accessing LayerCake context and calculated values (width/height, scales, etc) and improves types (chartContext())
<Chart>
  <LayerCake>
    <ChartContext>
      <slot />
    </ChartContext>
  </LayerCake>
</Chart>

Layout components

  • Canvas
    • Full width/height of container (like Svg) (commit)
    • scaleCanvas() integration
    • TransformContext integration
    • class support
  • Svg
    • TransformContext integration
    • class support
  • Html
    • class support
@techniq
Copy link
Owner Author

techniq commented Jun 7, 2024

@mhkeller gathering some changes I've made (or plan to) within LayerChart, some of which might be worth pushing upstream to LayerCake (such as full width Canvas). Integration with LayerChart contexts like TransformContext, GeoContext, and TooltipContext makes some of these changes impractical to move ATM.

@mhkeller
Copy link

mhkeller commented Jun 7, 2024

Thanks I'll keep an eye on it. What does full width Canvas do?

@techniq
Copy link
Owner Author

techniq commented Jun 7, 2024

If you applied a padding (such as <Chart padding={{ top: 60 }}>) and zoom or translate the canvas, the chart would be "clipped" since the <canvas> is absolute positioned and inset based on the padding. The change uses context.translate() and the full container size (which aligns the results with <svg transform="...">)

The Choropleth example demonstrated this (compare to an older commit preview).

Before After
image image

You have to scale/zoom or drag/translate to see the issue (not really an issue with most static charts). This would be a problem with more chart types, but I've mostly only focused on Canvas support for geo (since it typically benefits the most with complex geojson). Also hoping to find a fix for the infinite loop issue before I expand out too much (might wait til Svelte 5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants