Skip to content

Commit cf67868

Browse files
State improvements (#663)
* Geopoint icons remove controls (#772) * fix for empty layers toggle showing small circle * geopoint-icons-remove-controls * Additional axis examples (#764) * fix for empty layers toggle showing small circle * New barchart-xinterval-xinset and linechart-tickspacing - updates to Axis.md and BarChart.md text - updated Scatterplot domain-nice to use Switch instead of autotoggling * added needed padding * Add `tickSpacing` @default to jsdoc * refine docs --------- Co-authored-by: Sean Lynch <techniq35@gmail.com> * feat(Chart|Svg): Support passing `clip` prop to hide overflown content * also add for `<Html>` layers * Clipping (#774) * Text trunc wrap fix (#775) * Update deps (namely Svelte to 5.48.2 with dev-mode performance improvements) * Add clip to collision detection example * cleanup import * Stats (#776) * fix for empty layers toggle showing small circle * initial * move to footer * Landing Page Stats - Stats handled by src/lib/Stats.svelte - stats loaded via svelte remote function $lib/stats.remote.ts - stats nonblock via {#await} - for scrolling NPM downloads - Used ScrollValue from Svelte-UX - npm scrolling paused if not in viewport (used runed inViewport). This allows for consistent 1st visualization. - npm scrolling also pauses if npm hovered - less jarring - all stats are links to corresponding pages (NPM, Github, Discord, Bluesky) - responsive design dropping to block at small screens * refine using runed's useInterval with pause/resume * Use `GITHUB_API_TOKEN` if available (docs/.env, env var). Improve error handling --------- Co-authored-by: Sean Lynch <techniq35@gmail.com> * Missing clips (#778) * fix for empty layers toggle showing small circle * missing-clips * add `User-Agent` header to make Github happy when running in Cloudflare - https://docs.github.com/en/rest/overview/resources-in-the-rest-api#user-agent-required * Open in LLM feature (#753) * Open in LLM feature * removed grok * open-in-llm-component - rewrote copy for LLMs * minor copy change * used markdown icons * llms.txt - 3 levels 1. Individual pages like `layerchart.com/docs/components/Linechart/llms.txt .` 2. Site links index at `layerchart.com/llms.txt` 3. Complete text at `layerchart.com/docs/llms.txt .` API endpoint creation for sections 1. Getting Started 2. Guide Pages 3. Components 4. Individual Examples 5. Utils Added processMarkdownContent(content) to handle custom markdown conversion to vanilla MD for LLMs. In `docs/src/lib/markdown/utils.ts` * fix spelling error * another spelling fix * Change OpenLLMs.svelte to OpenWithButton.svelte - cleaned up logic on `ddocs/src/routes/docs/guides/[name]/llms.txt/+server.ts` was getting title by url name, now uses frontmatter like others. * Change "View Page Markdown" to open in modal * refine OpenWithButton * update `p` markdown component to only apply margins when within main (not nested in note, blockquote, etc) * refine some wording * Create guides content collection and use to build menu * Extract and consolidate common llms.txt utils * Add common sortCollection util * add component links to examples llms.txt * consolidate more logic into llms/utils.ts * Replace `fs`/`path` usage with Vite's `import.meta.glob` * Move processMarkdownContent to llms/utils.ts * processMarkdownContent within generateComponentMarkdown / generateUtilMarkdown * include `:example { }`directives * cleanup * move related section to bottom of component docs (also matches llms.txt) * Add examples to component llms.txt * Rename `Component docs` to just `Components` when viewing an example * Extract generateExampleMarkdown from request handler into llms/tuils.ts * move generateFullLlmsTxt to llms/utils.ts, always use markdownResponse (remove textResponse) * move generateLlmsTxt to llms/utils.ts, * replace generateGuidesSection with generateCollectionListSection * Uwe docsUrl in `inlineExampleDirectives` and `generateComponentMarkdown` to build example links * remove unneeded exports * cleanup types * delete outdated tests * update docs test setup to match packages/layerchart * add llms tests and add to ci * Add LLMs link to frontpage footer * Update LLMs docs * Disable docs tests until contentCollections() can be enabled without triggering `__dirname is not defined` --------- Co-authored-by: Sean Lynch <techniq35@gmail.com> * Update deps * fix dagre `module is not defined` after bumping deps (but not dagre to v2). If dagre was bumped to v2, was getting: `"Dynamic require of "@dagrejs/graphlib" is not supported"` * Tree clips (#779) * fix for empty layers toggle showing small circle * add missing clips for tree examples * fix build * extract table of contents from markdown instead of html * add toc to guides * improve header and toc slugs when `:icon{..}` directives are used * remove `meta.tableOfContents` and just use `metadata.toc` to determine when to display toc. Add toc to getting starting but disable until heading improved * Use IntersectionObserver for improve active highlighting * Update deps * Clip force text example * flexsearch (#745) * flexsearch - command-K toggles open/close - Escape toggles search closed, clicking outside search box toggles closed - used runed persistedState to show last 5 searches - seen only after selecting a search option, and 2nd search - supports clearing prior searches - needs some styling help - dummy data needs replaced. * update pnpm-lock.yaml * Fix catalog example paths * Remove outdated examples (markdown) content collection * Build search index using content collections and examples catalog, and use remote function to query * Cleanup search * Improve display of search results * improve display of search results * fix sticky search input * refine results * move stripMarkdown to lib/markdown/utils * refine results * refine search styling * Fix reactivity when loading examples * support searching from home page * Use `@layerstack/svelte-state` instead of '@layerstack/svelte-stores' for javascript media query * Refactor search functionality: replace remote search with local index and improve search performance * improve search * Dynamically import search module to avoid SSR bundling issues (fix Cloudflare) * Add quick links when no search is set * Add support for headings in search entries * Add top-level navigation to search * Use preprender remote function instead of API server endpoint and fetch * Revert "Use preprender remote function instead of API server endpoint and fetch" This reverts commit f9427de. --------- Co-authored-by: Sean Lynch <techniq35@gmail.com> * Cleanup headers (especially remove duplicate "## Examples" headers causing key error) * add playwright-cli skills * fix parent component's table of contents showing on examples * generate:all (catalog, screenshots) * remove "actions" export * Add LineChart threshold example * fix threshold with linear gradient examples * add links * Do not highlight/mark examples in search * Ignore anchor tags / hash fragment (ex. `#examples`) in llms.txt URLs * fix(Threshold): Properly clip `above` snippet (resolving 1/2 width clipping issues when using Spline) * refine * Add `defaultExample` to `components` collection to use first on docs (ex. BarChart.md) and fallback to first example in catalog (ex. BarChart.json). Use ComponentLink for example component links and also Related section in docs * Improve ExampleScreenshot when image is not available, with fallback icon * Improve primitives doc * fix border on light mode * cleanup * docs(Points): Add docs regarding color * Add Nocturne to showcase * fix(showcase): handle source-only items * Cmd K (uppercase) (#784) * Fix loading web containers * remove color from Axis/arrow-markers example * Extract ExampleListing component and show additional examples at the bottom of an example * Improve/fix histogram examples (better axis ticks and use Rect instead of Bar) * fix(BarChartControls): handling of interval and threshold sizing * generate:all to update catalog and screenshots * Hide playground menu item until it's more polished * fix clipping * fix showing component source for layers (Layer, Svg, etc) * fix(Bar): Fix bar rounding direction when using xReverse/yReverse with interval scales * fix(Bar): Fix bar rounding direction when using xReverse/yReverse with interval scales * remove reverse/annotations from example * Move data doc to content/guides like other guides * Remove old reference * remove unneeded page test * Fix Arc tooltip test * Integrate SeriesState into ChartChart and improve handling of series data * Improve examples page on small viewports * Improve animated globe example on small viewports * feat(Chart): Add cartesian pan/zoom via `transform={{ mode: 'domain' }}` with single or both axis support. Resolves #366 * Improve interop between brush and transform * Automatically clip marks when using transform mode: 'transform' (like `brush`). Add BarChart examples * feat(Chart): Support `motion` prop to transition x/y scales using tween or spring * Add a fallback transformState until bind is applied * Update catalog and screenshots * Fix tootip/highlight handling for ScatterChart * Fix AreaChart with separate series data * Fix tooltip for ScatterChart single dimension example. Remove grid from BarChart single dimension * fix light mode screenshots * Update remaining examples for `<Chart tooltip={...}>` => `<Chart tooltipContext={...}>` rename (needed for `tooltip` snippet) * Fix disabling tooltip context * Move brush, padding, and onTooltipClick from simplified charts (Area, Line, Bar, Scatter) to Chart/ChartState * Update catalog * fix(Area|Highlight): Properly handling diveraging stack layouts for negative values (line, highlight point). Resolves #677 * Add support for setting scale, transcale, domain extents and custom constrain handler. Add docs * regenerate catalog and screenshots * Replace `geo.applyTransform` with `transform.mode: 'projection' | 'rotate'` * Support category for guides, group state docs * simplify example * organize doc * fix translucent / backpane example (remove unneeded transform state sync in GeoProjection) * Swap order of play/pause and current feature after moving button from right to left side * Rename domainExtent `original` to `data` * Add examles for different `zoomTo` use cases * Add examples for each quick reference use cases * cleanup * Add pan zoom with dynamic data example * Clip highlight/points/labels as well when transform is enabled * feat: Add inertia (momentum) support for transform drag gestures * Update data examples to use Chart instead of LineChart * feat: Data driven primitives * fix(TooltipContext): Support band mode with array-based range accessors (e.g. histograms using `x={['x0', 'x1']}`) * Simplify histogram examples using new data-driven primitives * Moved valueAxis-aware grid/rule defaults from BarChart into ChartChildren for all chart types * regenerate catalog and screenshots * add planet distances example (TransformContext and more) * feat: Add Image component. Resolves #628 * Improve planet distances example * regenerate catalog and screenshots * add inertia dragging to animated globe * Remove `transform={{ mode: 'rotate' }}` and handle with `transform={{ mode: 'projection' }}`. Add `transform={{ apply: { translate: boolean, rotation: boolean, scale: boolean } }}` for granular control (and support zoom with rotation) * Add pan zoom domain extent example for BarChart * feat: Add Cell mark. Resolves #627. * feat: Add Chord layout and Ribbon primitive * Add gradient example * Fix html pan/zoom image * Add Chord example with axis ticks * Add ridgeline example * Improve ridgeline example * Add another ridgeline example * generate catalog and screenshots * Add more examples to homepage * Add oscilloscope-ridgeline example (WIP) * Reduce Cloudflare Worker bundle size to stay under 25 MiB limit Load shiki dynamically on the client only (using the lighter bundle/web) and externalize shiki + CodeMirror from the SSR bundle since they are not needed server-side. * Improve Chord/ticks example and fix "negative radius" error in Chord/Ribbon * re-add codemirror to allow resolving * Improve Chord/hover tooltips * feat: Add geo projection support for primitives (Circle, Rect, etc). Also enable motion support when using data mode. * Add College football map example * feat(Spline): Support geo projection. Add geo route example * Move geo-route example from line to spline * Improve oscilloscope frequency example (clipped high/unused frequencies) * Add satellite example * Fix hash target scrolling * feat: Add Vector component * Update primitives to support data driven class, opacity, etc * Improve election-wind-map example * Replace flow-field example with wind-map * update catalog and screenshots * fix(Highlight): Use valueAxis instead of Array.isArray(yValue) for axis detection to avoid incorrectly showing horizontal highlights on grouped/stacked series charts * Add BarChart series-stack-separate-data example (issue #486) * fix(Points|Labels): Correctly position when using x1 / y1 scales (issue #773) * fix(Points|Labels): Correctly position when using array accessors (duration charts, etc). Fixes #633 * update catalog and screenshots * feat(Bar): Support fixed `width` and `height` props to override scale-derived dimensions, centering the bar within its band. Resolves #360 * feat(Labels): Support `seriesKey` in `labels` prop to filter which series renders labels. Resolves #633 * update catalog and screenshots * breaking(Brush): Redesign brush API * feat(SeriesState): Support passing `selected` as part of series declaration (Ex. ` <Chart series={...}>`). Add docs (including programmatic control example), and tests * Fix baseline for multi-series charts * Show guides not in category (ex. layers.md) before those in category (ex. state / brush.md) * improve layout * feat(TransformContext): Add `scrollActivationKey` option to require a modifier key (meta, alt, control, shift) for scroll/wheel zoom/pan, preventing accidental page scroll from triggering transforms. Also rename `initialScrollMode` to `scrollMode` and make it reactive * Fix brush sync beteween 2 charts (AreaChart/brush-sync) * Fix zoomOnBrush test * docs: Add tooltip guide * Add links between guides and context/api * refine * cleanup * Remove explicit order from guides (sort alpha) except overview * Fix GeoSpline * Add geo guide * clip histogram examples so transitions do not extend passed container * generate catalog and screenshots * Add animation guide * Update state overview * feat: Mark registration for implicit series/domain calculation and unified component tree for Canvas rendering Marks register data, accessors, and colors with Chart via registerMark() for automatic domain calculation and implicit series generation, eliminating the need for explicit y={[...]} or series props. A new registerComponentNode() API replaces the flat Canvas registry with a tree structure, fixing Group transform scoping (fixes #662) and providing composite-mark detection for child marks. * Improve data guide * Add test to check if domain is updated when hiding implicit and explicit series * Add structure guide to explain snippets and Chart / simplified chart * Setup`pnpm bench` to help with performance evalulation * refactor: consolidate registerMark into registerComponentNode * cleanup for clarity (number accessor is only used recursively in accessor() with x={[0, 1]}) * feat: implement edge rounding for stackDiverging layout in BarChart * feat: add `downloadImage`, `downloadSvg`, `getChartImageBlob`, and `getChartSvgString` utilities to export charts as PNG/JPEG/WebP images or SVG files * refactor: consolidate component tree and mark registration into ChartState * fix(Canavs): support `strokeOpacity` for Path component * Remove outdated warning * fix(Text): handle inline styles and CSS class-based text-anchor * test(canvas): add comprehensive test suite for canvas utility functions * fix(ClipPath): Support canvas layers. Resolves #660 * fix(Canvas): support event handlers on Group components in canvas mode * fix(Rect): Handle strokeOpacity when using canvas layers * fix(docs): strip markdown links from TOC heading text * fix(TransformState): properly handle y axis when in domain/cartesian mode * feat(Highlight): Support data-driven radius for highlight points. Add docs * Add a pan/zoom with overview example to show how transform/brush can work together with separate charts * Add zoomable bubble chart example for ScatterChart * update catalog and screenshots * docs: Add world map transform examples (canvas & projection modes) with click-to-zoom * docs: Add world transform examples (canvas and projection) similar to US * feat: Support continuous color scales via `cScale` prop without requiring `cRange`. Simplify LineChart/gradient-encoding example * Add migration guides: `v1 -> v2` and `next -> state-refactor` * Improve v1 => v2 guide * feat: Add BoxPlot and Violin components * fix typos * cleanup * improve styles doc * feat: Add Contour, Density, Raster components * update catalog and screenshots * docs: Add seriesKey mark awareness and get*Props removal to migration guide * feat: Auto-compute Bar/Bars mount animation initial values from chart scales Bar now automatically derives `initialY`/`initialHeight` (vertical) or `initialX`/`initialWidth` (horizontal) from the chart's scale range when `motion` is configured, removing the need to hardcode pixel values. Also improves `valueAxis` inference on `ChartState` — when not explicitly set, it is now derived from scale types (band scale on y → `valueAxis: 'x'`, band scale on x → `valueAxis: 'y'`). * fix: `flattenPathData` now handles relative arc commands, fixing rounded bars starting below the baseline during mount animation * fix(Area): Handle degenerate domains (e.g. all-zero data) and unify y0/y1 baseline logic * fix LineChart defining single axis (<LineChart axis="x">) * Handle class for new statistic components * Show canvas support for Density * Add Density/weighted example * feat(Spline): Add motion support for mount animation from baseline * Add tween examples for Area/AreaChart/BarChart/LineChart * generate catalog and images, add more examples to frontpage * Add tooltip circle to college footmap map * fix(Tooltip): Apply inverse transform for quadtree lookup when zoomed/panned * Improve perf of college football map by using canvas instead of projection mode (and scale images/etc based on zoom) * Improve Density/walmart example with pan/zoom, tooltip, and improved data * Improve Raster/math-functions example * Update Raster to support Canavs and Html layers (not just Svg) * Move download after Edit * Add contours switch to Raster/math-functions * Fix tooltip value resolution for ArcChart series with per-item data by falling back to ctx.x when ctx.y is unset * fix(Area): Default y0 baseline to chart's yBaseline when set * Improve handling of arc/pie chart tooltips * Cleanup ChartState * fix series colors without breaking color scale * Improve tooltip data handling for quadtree and voronoi modes * Update and use DefaultTooltip for ScatterPlot use cases * fix(Tooltip): Fade non-highlighted series items on hover to match chart highlight state * Improve migration guide, handle diff formatting * improve diff style * Cleanup migration guides * Lazily load Example unless on detail view or initially within viewport * Add TransformContext/pan-zoom-axis example * update catalog and screenshots * improve TransformContext/planet-distantces example * Fix handling of x1Domain when toggling series/legend * Move scale/domain/baseline/nice logic from BarChart into ChartState * update catalog * add logging * Add safeguard for explicitly using Examples header * Register Dagre as composite-mark to prevent child marks from polluting chart scales with raw layout coordinates * Rename `registerComponentNode` to `registerComponent` * update text docs * Use ChartState type instead of removed ChartContextValue * Remove stroke from eclipses example * Fix BarChart regressions from ChartState scale/baseline refactor - Fix yReverse checking props.yScale instead of resolved _yScaleProp, which reversed band scale domain order (horizontal diverging bars) - Fix xInterval/yInterval not taking precedence over bandPadding for scale selection, collapsing time-based bars into a single band - Fix auto-baseline ignoring explicit null by using !== undefined check, and update single-stack example to use xBaseline={null} * Update Density/walmart to scale stroke/radius by zoom/scale --------- Co-authored-by: Scott Rhamy <scottrhamy@me.com>
1 parent 0d35cae commit cf67868

2,307 files changed

Lines changed: 56140 additions & 11388 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions

.changeset/add-stats-utils.md

Lines changed: 8 additions & 0 deletions

.changeset/add-violin-component.md

Lines changed: 7 additions & 0 deletions

.changeset/afraid-jobs-say.md

Lines changed: 5 additions & 0 deletions
Lines changed: 7 additions & 0 deletions

.changeset/blue-rules-feel.md

Lines changed: 5 additions & 0 deletions

.changeset/breezy-oranges-drive.md

Lines changed: 5 additions & 0 deletions

.changeset/bright-bubbles-zoom.md

Lines changed: 5 additions & 0 deletions

.changeset/brush-api-refactor.md

Lines changed: 22 additions & 0 deletions

.changeset/clear-moose-rush.md

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)