@fundar/data-chart-telling 1.16.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/configuration/ConfigVars.svelte +14 -0
- package/dist/configuration/ConfigVars.svelte.d.ts +3 -0
- package/dist/configuration/config.svelte.d.ts +5 -0
- package/dist/configuration/config.svelte.js +20 -6
- package/dist/configuration/themes/dark.js +1 -1
- package/dist/configuration/themes/editorial.js +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +4 -1
- package/dist/layout/base/BasePlotLayout.svelte +1 -1
- package/dist/layout/figure/Figure.svelte +5 -12
- package/dist/layout/figure/FigureChrome.svelte +2 -10
- package/dist/layout/geometry/GeometryLayout.svelte +219 -44
- package/dist/layout/hover/HoverDefaults.d.ts +52 -0
- package/dist/layout/hover/HoverDefaults.js +96 -0
- package/dist/layout/hover/HoverLayers.d.ts +35 -0
- package/dist/layout/hover/HoverLayers.js +122 -0
- package/dist/layout/hover/HoverSettings.js +4 -1
- package/dist/layout/hover/HoverShapes.d.ts +44 -0
- package/dist/layout/hover/HoverShapes.js +103 -0
- package/dist/layout/hover/PlotHover.svelte.d.ts +18 -0
- package/dist/layout/hover/PlotHover.svelte.js +54 -1
- package/dist/layout/legend/DisabledStyle.d.ts +1 -1
- package/dist/layout/legend/DisabledStyle.js +1 -1
- package/dist/layout/legend/DiscreteBadgeItem.svelte +1 -1
- package/dist/layout/legend/DiscreteSection.svelte +1 -1
- package/dist/layout/legend/LegendState.svelte.d.ts +14 -2
- package/dist/layout/legend/LegendState.svelte.js +23 -4
- package/dist/layout/legend/LegendText.d.ts +4 -1
- package/dist/layout/legend/LegendText.js +7 -1
- package/dist/layout/margins/PlotMargins.svelte.d.ts +2 -2
- package/dist/layout/margins/PlotMargins.svelte.js +2 -2
- package/dist/layout/plot/Core.svelte +2 -2
- package/dist/layout/plot/Plot.svelte +4 -2
- package/dist/layout/plot/Plot.svelte.d.ts +2 -1
- package/dist/layout/plot/PublicPlotContext.d.ts +6 -0
- package/dist/layout/plot/PublicPlotContext.js +8 -0
- package/dist/layout/scales/ScalesLayout.svelte +1 -1
- package/dist/layout/styles/ValueLabels.d.ts +43 -4
- package/dist/layout/styles/ValueLabels.js +87 -19
- package/dist/layout/timeline/Timeline.svelte +5 -1
- package/dist/layout/tooltip/TooltipState.svelte.d.ts +8 -9
- package/dist/layout/tooltip/TooltipState.svelte.js +28 -29
- package/dist/markers/MarkerKinds.d.ts +5 -0
- package/dist/markers/MarkerKinds.js +1 -0
- package/dist/markers/area/AreaMarker.svelte +3 -0
- package/dist/markers/arrow/ArrowMarker.svelte +9 -5
- package/dist/markers/band/BandMarker.svelte +74 -0
- package/dist/markers/band/BandMarker.svelte.d.ts +7 -0
- package/dist/markers/band/Bands.d.ts +16 -0
- package/dist/markers/band/Bands.js +48 -0
- package/dist/markers/bar/BarMarker.svelte +50 -96
- package/dist/markers/bollinger/BollingerMarker.svelte +3 -0
- package/dist/markers/box/BoxMarker.svelte +3 -1
- package/dist/markers/cell/CellMarker.svelte +11 -7
- package/dist/markers/contour/ContourMarker.svelte +3 -0
- package/dist/markers/delaunay/DelaunayLinkMarker.svelte +9 -5
- package/dist/markers/delaunay/DelaunayMeshMarker.svelte +3 -0
- package/dist/markers/density/DensityMarker.svelte +3 -0
- package/dist/markers/difference/DifferenceMarker.svelte +3 -0
- package/dist/markers/dot/DotMarker.svelte +11 -6
- package/dist/markers/geo/GraticuleMarker.svelte +3 -0
- package/dist/markers/geo/SphereMarker.svelte +3 -0
- package/dist/markers/hover/HoverMarker.svelte +7 -249
- package/dist/markers/hover/HoverMarker.svelte.d.ts +4 -27
- package/dist/markers/hull/HullMarker.svelte +3 -0
- package/dist/markers/image/ImageMarker.svelte +3 -0
- package/dist/markers/line/LineMarker.svelte +3 -0
- package/dist/markers/link/LinkMarker.svelte +3 -0
- package/dist/markers/raster/RasterMarker.svelte +3 -0
- package/dist/markers/rect/RectMarker.svelte +25 -17
- package/dist/markers/regression/RegressionMarker.svelte +3 -0
- package/dist/markers/rule/RuleMarker.svelte +15 -5
- package/dist/markers/text/TextFit.d.ts +44 -0
- package/dist/markers/text/TextFit.js +86 -0
- package/dist/markers/text/TextMarker.svelte +186 -90
- package/dist/markers/text/TextMarker.svelte.d.ts +2 -0
- package/dist/markers/tick/TickMarker.svelte +9 -3
- package/dist/markers/trail/TrailMarker.svelte +3 -0
- package/dist/markers/utils/BoxLabel.d.ts +58 -0
- package/dist/markers/utils/BoxLabel.js +175 -0
- package/dist/markers/utils/MarkerEvents.d.ts +23 -0
- package/dist/markers/utils/MarkerEvents.js +44 -0
- package/dist/markers/utils/MarkerLabel.svelte +33 -0
- package/dist/markers/utils/MarkerLabel.svelte.d.ts +10 -0
- package/dist/markers/utils/PointPixel.d.ts +37 -0
- package/dist/markers/utils/PointPixel.js +44 -0
- package/dist/markers/utils/RowStroke.d.ts +9 -21
- package/dist/markers/utils/RowStroke.js +10 -21
- package/dist/markers/utils/RowStyle.d.ts +26 -0
- package/dist/markers/utils/RowStyle.js +55 -0
- package/dist/markers/vector/VectorMarker.svelte +3 -0
- package/dist/markers/voronoi/VoronoiMarker.svelte +9 -5
- package/dist/markers/voronoi/VoronoiMeshMarker.svelte +3 -0
- package/dist/markers/waffle/WaffleMarker.svelte +9 -5
- package/dist/phases/Pipeline.d.ts +10 -8
- package/dist/phases/Pipeline.js +13 -9
- package/dist/phases/context/ContextPhase.d.ts +22 -0
- package/dist/phases/context/ContextPhase.js +23 -0
- package/dist/phases/context/RowContext.d.ts +35 -0
- package/dist/phases/context/RowContext.js +95 -0
- package/dist/phases/data/DataPhase.d.ts +4 -4
- package/dist/phases/data/DataPhase.js +53 -12
- package/dist/phases/hover/HoverPhase.d.ts +6 -7
- package/dist/phases/hover/HoverPhase.js +28 -15
- package/dist/phases/mapping/MappingPhase.d.ts +4 -4
- package/dist/phases/mapping/MappingPhase.js +4 -3
- package/dist/phases/markers/MarkerStyles.d.ts +26 -0
- package/dist/phases/markers/MarkerStyles.js +126 -0
- package/dist/phases/markers/MarkersPhase.d.ts +5 -5
- package/dist/phases/markers/MarkersPhase.js +8 -6
- package/dist/phases/scales/ScalesPhase.d.ts +4 -4
- package/dist/phases/scales/ScalesPhase.js +4 -4
- package/dist/phases/sharedScales/SharedScalesPhase.d.ts +2 -2
- package/dist/phases/sharedScales/SharedScalesPhase.js +2 -2
- package/dist/phases/statistics/MarkerGrouping.d.ts +0 -9
- package/dist/phases/statistics/MarkerGrouping.js +0 -16
- package/dist/phases/statistics/StatisticsPhase.js +1 -1
- package/dist/phases/styles/StylesPhase.d.ts +3 -3
- package/dist/phases/styles/StylesPhase.js +2 -2
- package/dist/phases/tooltip/TooltipPhase.d.ts +4 -4
- package/dist/phases/tooltip/TooltipPhase.js +10 -7
- package/dist/phases/transforms/Transforms.js +3 -1
- package/dist/phases/transforms/TransformsPhase.d.ts +3 -3
- package/dist/phases/transforms/TransformsPhase.js +60 -6
- package/dist/phases/transforms/methods/TreemapTransform.d.ts +28 -0
- package/dist/phases/transforms/methods/TreemapTransform.js +119 -0
- package/dist/plots/correlation/heatmap/defaults.d.ts +2 -2
- package/dist/plots/correlation/heatmap/defaults.js +23 -8
- package/dist/plots/correlation/heatmap/markers.d.ts +2 -10
- package/dist/plots/correlation/heatmap/markers.js +11 -37
- package/dist/plots/correlation/scatter/defaults.d.ts +2 -2
- package/dist/plots/correlation/scatter/defaults.js +9 -3
- package/dist/plots/correlation/scatter/markers.d.ts +3 -3
- package/dist/plots/correlation/scatter/markers.js +6 -5
- package/dist/plots/distribution/box/BoxSummaries.d.ts +17 -8
- package/dist/plots/distribution/box/BoxSummaries.js +90 -40
- package/dist/plots/distribution/box/defaults.d.ts +2 -2
- package/dist/plots/distribution/box/defaults.js +9 -6
- package/dist/plots/distribution/box/markers.d.ts +2 -2
- package/dist/plots/distribution/box/markers.js +3 -3
- package/dist/plots/distribution/density/defaults.d.ts +2 -2
- package/dist/plots/distribution/density/defaults.js +17 -1
- package/dist/plots/distribution/density/markers.d.ts +2 -2
- package/dist/plots/distribution/density/markers.js +4 -4
- package/dist/plots/distribution/histogram/defaults.d.ts +2 -2
- package/dist/plots/distribution/histogram/defaults.js +22 -27
- package/dist/plots/distribution/histogram/markers.d.ts +3 -12
- package/dist/plots/distribution/histogram/markers.js +21 -62
- package/dist/plots/distribution/pyramid/defaults.d.ts +2 -2
- package/dist/plots/distribution/pyramid/defaults.js +7 -4
- package/dist/plots/distribution/pyramid/markers.d.ts +2 -12
- package/dist/plots/distribution/pyramid/markers.js +16 -66
- package/dist/plots/distribution/violin/defaults.d.ts +2 -2
- package/dist/plots/distribution/violin/defaults.js +9 -7
- package/dist/plots/distribution/violin/markers.d.ts +2 -2
- package/dist/plots/distribution/violin/markers.js +4 -4
- package/dist/plots/evolution/area/defaults.d.ts +2 -2
- package/dist/plots/evolution/area/defaults.js +1 -1
- package/dist/plots/evolution/area/markers.d.ts +2 -2
- package/dist/plots/evolution/area/markers.js +4 -4
- package/dist/plots/evolution/line/defaults.d.ts +2 -2
- package/dist/plots/evolution/line/defaults.js +1 -1
- package/dist/plots/evolution/line/markers.d.ts +2 -2
- package/dist/plots/evolution/line/markers.js +3 -3
- package/dist/plots/evolution/slope/defaults.d.ts +2 -2
- package/dist/plots/evolution/slope/defaults.js +8 -4
- package/dist/plots/evolution/slope/markers.d.ts +2 -2
- package/dist/plots/evolution/slope/markers.js +3 -3
- package/dist/plots/evolution/sparkline/defaults.d.ts +2 -2
- package/dist/plots/evolution/sparkline/defaults.js +5 -2
- package/dist/plots/evolution/sparkline/markers.d.ts +2 -2
- package/dist/plots/evolution/sparkline/markers.js +3 -3
- package/dist/plots/map/geo/Core.svelte +3 -3
- package/dist/plots/map/geo/defaults.d.ts +2 -2
- package/dist/plots/map/geo/phases/data.d.ts +1 -1
- package/dist/plots/map/geo/phases/data.js +1 -1
- package/dist/plots/map/geo/phases/hover.d.ts +2 -2
- package/dist/plots/map/geo/phases/hover.js +3 -3
- package/dist/plots/map/geo/phases/markers.d.ts +2 -2
- package/dist/plots/map/geo/phases/markers.js +5 -4
- package/dist/plots/map/geo/phases/scales.d.ts +2 -2
- package/dist/plots/map/geo/phases/scales.js +2 -2
- package/dist/plots/part-of-a-whole/treemap/Plot.svelte +47 -0
- package/dist/plots/part-of-a-whole/treemap/Plot.svelte.d.ts +26 -0
- package/dist/plots/part-of-a-whole/treemap/defaults.d.ts +10 -0
- package/dist/plots/part-of-a-whole/treemap/defaults.js +183 -0
- package/dist/plots/ranking/bar/defaults.d.ts +2 -2
- package/dist/plots/ranking/bar/defaults.js +15 -9
- package/dist/plots/ranking/bar/markers.d.ts +4 -14
- package/dist/plots/ranking/bar/markers.js +45 -86
- package/dist/plots/ranking/bullet/defaults.d.ts +2 -2
- package/dist/plots/ranking/bullet/defaults.js +4 -4
- package/dist/plots/ranking/bullet/markers.d.ts +3 -3
- package/dist/plots/ranking/bullet/markers.js +11 -12
- package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +3 -3
- package/dist/plots/ranking/cleveland/ClevelandMarkers.js +28 -23
- package/dist/plots/ranking/cleveland/defaults.d.ts +2 -2
- package/dist/plots/ranking/cleveland/defaults.js +7 -4
- package/dist/plots/ranking/dumbbell/defaults.d.ts +2 -2
- package/dist/plots/ranking/forest/defaults.d.ts +2 -2
- package/dist/plots/ranking/lollipop/defaults.d.ts +2 -2
- package/dist/types/configuration/styling.d.ts +31 -2
- package/dist/types/layout/context.d.ts +21 -0
- package/dist/types/layout/context.js +1 -0
- package/dist/types/layout/hover.d.ts +3 -0
- package/dist/types/layout/legend.d.ts +8 -1
- package/dist/types/layout/mapping.d.ts +12 -3
- package/dist/types/layout/scales.d.ts +6 -0
- package/dist/types/layout/styles/values.d.ts +8 -2
- package/dist/types/layout/tooltip.d.ts +11 -4
- package/dist/types/markers/axis/arrow.d.ts +2 -8
- package/dist/types/markers/axis/axisBasedMarkersConfig.d.ts +2 -1
- package/dist/types/markers/axis/band.d.ts +24 -0
- package/dist/types/markers/axis/band.js +1 -0
- package/dist/types/markers/axis/bar.d.ts +6 -10
- package/dist/types/markers/axis/cell.d.ts +5 -5
- package/dist/types/markers/axis/delaunayLink.d.ts +2 -2
- package/dist/types/markers/axis/hover.d.ts +60 -15
- package/dist/types/markers/axis/rect.d.ts +4 -8
- package/dist/types/markers/axis/rule.d.ts +2 -16
- package/dist/types/markers/axis/tick.d.ts +2 -2
- package/dist/types/markers/axis/voronoi.d.ts +2 -2
- package/dist/types/markers/axis/waffle.d.ts +4 -3
- package/dist/types/markers/basic/dot.d.ts +2 -2
- package/dist/types/markers/basic/text.d.ts +56 -14
- package/dist/types/markers/channels/commonMarkerConfig.d.ts +8 -1
- package/dist/types/markers/channels/commonMarkerConfigWithArea.d.ts +1 -2
- package/dist/types/markers/channels/commonMarkerConfigWithLabel.d.ts +10 -0
- package/dist/types/markers/channels/commonMarkerConfigWithLabel.js +1 -0
- package/dist/types/markers/channels/commonMarkerEvents.d.ts +17 -0
- package/dist/types/markers/channels/commonMarkerEvents.js +13 -0
- package/dist/types/markers/common.d.ts +1 -0
- package/dist/types/markers/common.js +1 -0
- package/dist/types/markers/geo/contour.d.ts +2 -1
- package/dist/types/markers/geo/graticule.d.ts +2 -1
- package/dist/types/markers/geo/link.d.ts +2 -1
- package/dist/types/markers/geo/sphere.d.ts +2 -1
- package/dist/types/markers/geo/vector.d.ts +2 -1
- package/dist/types/phases/context/phase.d.ts +7 -0
- package/dist/types/phases/context/phase.js +1 -0
- package/dist/types/phases/data/phase.d.ts +7 -2
- package/dist/types/phases/hover/phase.d.ts +10 -5
- package/dist/types/phases/index.d.ts +2 -1
- package/dist/types/phases/kind.d.ts +11 -8
- package/dist/types/phases/mapping/phase.d.ts +2 -2
- package/dist/types/phases/markers/phase.d.ts +3 -3
- package/dist/types/phases/scales/phase.d.ts +4 -4
- package/dist/types/phases/stage.d.ts +3 -3
- package/dist/types/phases/state.d.ts +8 -1
- package/dist/types/phases/statistics/phase.d.ts +2 -1
- package/dist/types/phases/styles/phase.d.ts +3 -2
- package/dist/types/phases/transforms/phase.d.ts +13 -2
- package/dist/types/plots/constants.d.ts +17 -19
- package/dist/types/plots/correlation/heatmap/props.d.ts +3 -3
- package/dist/types/plots/correlation/heatmap/state.d.ts +2 -2
- package/dist/types/plots/correlation/scatter/props.d.ts +3 -3
- package/dist/types/plots/correlation/scatter/state.d.ts +2 -2
- package/dist/types/plots/data/common.d.ts +19 -6
- package/dist/types/plots/data/geo.d.ts +1 -1
- package/dist/types/plots/distribution/box/props.d.ts +25 -3
- package/dist/types/plots/distribution/box/state.d.ts +6 -17
- package/dist/types/plots/distribution/density/props.d.ts +3 -11
- package/dist/types/plots/distribution/density/state.d.ts +2 -2
- package/dist/types/plots/distribution/histogram/props.d.ts +16 -11
- package/dist/types/plots/distribution/histogram/state.d.ts +2 -2
- package/dist/types/plots/distribution/pyramid/props.d.ts +3 -3
- package/dist/types/plots/distribution/pyramid/state.d.ts +2 -2
- package/dist/types/plots/distribution/violin/props.d.ts +4 -3
- package/dist/types/plots/distribution/violin/state.d.ts +2 -2
- package/dist/types/plots/evolution/area/props.d.ts +3 -3
- package/dist/types/plots/evolution/area/state.d.ts +2 -2
- package/dist/types/plots/evolution/line/props.d.ts +3 -3
- package/dist/types/plots/evolution/line/state.d.ts +2 -2
- package/dist/types/plots/evolution/slope/state.d.ts +2 -2
- package/dist/types/plots/evolution/sparkline/state.d.ts +2 -2
- package/dist/types/plots/map/geo/state.d.ts +1 -1
- package/dist/types/plots/part-of-a-whole/treemap/props.d.ts +29 -0
- package/dist/types/plots/part-of-a-whole/treemap/props.js +1 -0
- package/dist/types/plots/part-of-a-whole/treemap/state.d.ts +6 -0
- package/dist/types/plots/part-of-a-whole/treemap/state.js +1 -0
- package/dist/types/plots/props.d.ts +10 -4
- package/dist/types/plots/ranking/bar/props.d.ts +3 -3
- package/dist/types/plots/ranking/bar/state.d.ts +2 -2
- package/dist/types/plots/ranking/bullet/state.d.ts +2 -2
- package/dist/types/plots/ranking/cleveland/props.d.ts +3 -3
- package/dist/types/plots/ranking/cleveland/state.d.ts +2 -2
- package/dist/types/plots/ranking/dumbbell/props.d.ts +3 -3
- package/dist/types/plots/ranking/dumbbell/state.d.ts +2 -2
- package/dist/types/plots/ranking/forest/props.d.ts +3 -3
- package/dist/types/plots/ranking/forest/state.d.ts +2 -2
- package/dist/types/plots/ranking/lollipop/props.d.ts +3 -3
- package/dist/types/plots/ranking/lollipop/state.d.ts +2 -2
- package/dist/types/plots/styling.d.ts +24 -0
- package/dist/types/transforms/index.d.ts +3 -1
- package/dist/types/transforms/treemap.d.ts +32 -0
- package/dist/types/transforms/treemap.js +5 -0
- package/dist/utils/color/ColorTones.d.ts +19 -0
- package/dist/utils/color/ColorTones.js +64 -0
- package/dist/utils/color/CssColor.d.ts +14 -5
- package/dist/utils/color/CssColor.js +69 -27
- package/dist/utils/color/index.d.ts +4 -0
- package/dist/utils/color/index.js +4 -0
- package/dist/utils/grouping.d.ts +18 -1
- package/dist/utils/grouping.js +31 -0
- package/docs/concepts.md +3 -2
- package/docs/legend.md +8 -5
- package/docs/markers.md +110 -28
- package/docs/plots/evolution/line.md +1 -1
- package/docs/plots/evolution/slope.md +1 -1
- package/docs/plots/part-of-a-whole/treemap.md +103 -0
- package/docs/plots/ranking/bar.md +2 -1
- package/docs/plots/ranking/cleveland.md +1 -1
- package/docs/plots.md +21 -20
- package/docs/scales.md +3 -0
- package/docs/state.md +34 -1
- package/docs/styles-and-segments.md +20 -19
- package/docs/theming.md +6 -12
- package/docs/tooltip-and-hover.md +81 -3
- package/docs/transforms-and-statistics.md +17 -16
- package/examples/LineDates.svelte +1 -1
- package/examples/ResponsiveLine.svelte +3 -1
- package/examples/Treemap.svelte +13 -0
- package/examples/TreemapHover.svelte +25 -0
- package/examples/ValueLabels.svelte +1 -1
- package/examples/datasets/economic-activity.ts +40 -0
- package/examples/datasets/index.ts +1 -0
- package/llms-full.txt +11 -9
- package/llms.txt +4 -1
- package/package.json +3 -1
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { RowStyle } from '../utils/RowStyle';
|
|
3
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
4
|
import { BarX, BarY } from 'svelteplot';
|
|
3
5
|
import { usePlot } from '../../layout/plot/usePlot';
|
|
4
|
-
import { PlotContext } from '../../layout/plot/PlotContext';
|
|
5
6
|
import { MarkerChannels } from '../utils/MarkerChannels';
|
|
6
7
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
7
8
|
import type { BarMarkerConfig } from '../../types/markers/common';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Renders one `'bar'` marker: `role: 'segment'` (visible bar via
|
|
11
|
-
* `<BarX>`/`<BarY>`)
|
|
12
|
-
* one segment)
|
|
12
|
+
* `<BarX>`/`<BarY>`) or `role: 'hitArea'` (invisible hover hit region for
|
|
13
|
+
* one segment).
|
|
13
14
|
*/
|
|
14
15
|
let { marker }: { marker: BarMarkerConfig } = $props();
|
|
16
|
+
const events = MarkerEvents.use(() => marker);
|
|
15
17
|
|
|
16
18
|
const cfg = $derived(getConfiguration());
|
|
17
19
|
const data = $derived(marker.data ?? []);
|
|
18
20
|
const channelFill = $derived(MarkerChannels.buildFill(data, marker.color, marker.scales, cfg));
|
|
19
21
|
|
|
20
22
|
const plot = usePlot().svelteplot;
|
|
21
|
-
const hover = PlotContext.current()?.hover;
|
|
22
|
-
const enter = $derived(
|
|
23
|
-
marker.hover
|
|
24
|
-
? () => hover?.onPointer((marker.data ?? []) as Record<string, unknown>[])
|
|
25
|
-
: undefined
|
|
26
|
-
);
|
|
27
|
-
const leave = $derived(marker.hover ? hover?.onLeave : undefined);
|
|
28
23
|
function categoryScaleFor(isHorizontal: boolean) {
|
|
29
24
|
return isHorizontal ? plot.scales.y : plot.scales.x;
|
|
30
25
|
}
|
|
@@ -47,37 +42,41 @@
|
|
|
47
42
|
marker.thickness != null ? Math.max(0, (bandwidth - marker.thickness) / 2) : undefined}
|
|
48
43
|
{#if marker.isHorizontal}
|
|
49
44
|
<BarX
|
|
45
|
+
{...events.props}
|
|
50
46
|
{data}
|
|
51
47
|
y={marker.y}
|
|
52
48
|
x1={marker.x1}
|
|
53
49
|
x2={marker.x2}
|
|
54
|
-
insetTop={centered ??
|
|
50
|
+
insetTop={centered ??
|
|
51
|
+
(marker.styles?.insetTop != null ? marker.styles?.insetTop * bandwidth : undefined)}
|
|
55
52
|
insetBottom={centered ??
|
|
56
|
-
(marker.insetBottom != null ? marker.insetBottom * bandwidth : undefined)}
|
|
57
|
-
fill={channelFill ?? marker.styles?.fill}
|
|
58
|
-
fillOpacity={marker.styles?.fillOpacity}
|
|
59
|
-
stroke={marker.styles?.stroke}
|
|
60
|
-
strokeWidth={marker.styles?.strokeWidth}
|
|
61
|
-
strokeOpacity={marker.styles?.strokeOpacity}
|
|
53
|
+
(marker.styles?.insetBottom != null ? marker.styles?.insetBottom * bandwidth : undefined)}
|
|
54
|
+
fill={channelFill ?? RowStyle.of(marker.styles?.fill, data)}
|
|
55
|
+
fillOpacity={RowStyle.opacity(marker.styles?.fillOpacity)}
|
|
56
|
+
stroke={RowStyle.of(marker.styles?.stroke, data)}
|
|
57
|
+
strokeWidth={RowStyle.field(marker.styles?.strokeWidth)}
|
|
58
|
+
strokeOpacity={RowStyle.opacity(marker.styles?.strokeOpacity)}
|
|
62
59
|
strokeDasharray={marker.styles?.strokeDasharray}
|
|
63
|
-
borderRadius={marker.styles?.borderRadius}
|
|
60
|
+
borderRadius={RowStyle.field(marker.styles?.borderRadius)}
|
|
64
61
|
/>
|
|
65
62
|
{:else}
|
|
66
63
|
<BarY
|
|
64
|
+
{...events.props}
|
|
67
65
|
{data}
|
|
68
66
|
x={marker.x}
|
|
69
67
|
y1={marker.y1}
|
|
70
68
|
y2={marker.y2}
|
|
71
|
-
insetLeft={centered ??
|
|
69
|
+
insetLeft={centered ??
|
|
70
|
+
(marker.styles?.insetLeft != null ? marker.styles?.insetLeft * bandwidth : undefined)}
|
|
72
71
|
insetRight={centered ??
|
|
73
|
-
(marker.insetRight != null ? marker.insetRight * bandwidth : undefined)}
|
|
74
|
-
fill={channelFill ?? marker.styles?.fill}
|
|
75
|
-
fillOpacity={marker.styles?.fillOpacity}
|
|
76
|
-
stroke={marker.styles?.stroke}
|
|
77
|
-
strokeWidth={marker.styles?.strokeWidth}
|
|
78
|
-
strokeOpacity={marker.styles?.strokeOpacity}
|
|
72
|
+
(marker.styles?.insetRight != null ? marker.styles?.insetRight * bandwidth : undefined)}
|
|
73
|
+
fill={channelFill ?? RowStyle.of(marker.styles?.fill, data)}
|
|
74
|
+
fillOpacity={RowStyle.opacity(marker.styles?.fillOpacity)}
|
|
75
|
+
stroke={RowStyle.of(marker.styles?.stroke, data)}
|
|
76
|
+
strokeWidth={RowStyle.field(marker.styles?.strokeWidth)}
|
|
77
|
+
strokeOpacity={RowStyle.opacity(marker.styles?.strokeOpacity)}
|
|
79
78
|
strokeDasharray={marker.styles?.strokeDasharray}
|
|
80
|
-
borderRadius={marker.styles?.borderRadius}
|
|
79
|
+
borderRadius={RowStyle.field(marker.styles?.borderRadius)}
|
|
81
80
|
/>
|
|
82
81
|
{/if}
|
|
83
82
|
{:else}
|
|
@@ -85,77 +84,32 @@
|
|
|
85
84
|
{#if categoryScale?.type === 'band'}
|
|
86
85
|
{@const bandwidth = categoryScale.fn.bandwidth()}
|
|
87
86
|
{@const bandStart = Number(categoryScale.fn(marker.category as never) ?? 0)}
|
|
88
|
-
{@const insetLeft = (marker.insetLeft ?? 0) * bandwidth}
|
|
89
|
-
{@const insetRight = (marker.insetRight ?? 0) * bandwidth}
|
|
90
|
-
{@const insetTop = (marker.insetTop ?? 0) * bandwidth}
|
|
91
|
-
{@const insetBottom = (marker.insetBottom ?? 0) * bandwidth}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
onpointerenter={enter}
|
|
105
|
-
onpointerleave={leave}
|
|
106
|
-
/>
|
|
107
|
-
{:else}
|
|
108
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
109
|
-
<rect
|
|
110
|
-
class="dct-hit-area"
|
|
111
|
-
x={bandStart + insetLeft}
|
|
112
|
-
y={rangeMin + insetBottom}
|
|
113
|
-
width={Math.max(0, bandwidth - insetLeft - insetRight)}
|
|
114
|
-
height={Math.max(0, rangeMax - rangeMin - insetTop - insetBottom)}
|
|
115
|
-
fill="transparent"
|
|
116
|
-
onpointerenter={enter}
|
|
117
|
-
onpointerleave={leave}
|
|
118
|
-
/>
|
|
119
|
-
{/if}
|
|
87
|
+
{@const insetLeft = (marker.styles?.insetLeft ?? 0) * bandwidth}
|
|
88
|
+
{@const insetRight = (marker.styles?.insetRight ?? 0) * bandwidth}
|
|
89
|
+
{@const insetTop = (marker.styles?.insetTop ?? 0) * bandwidth}
|
|
90
|
+
{@const insetBottom = (marker.styles?.insetBottom ?? 0) * bandwidth}
|
|
91
|
+
<!-- The band runs the plot's whole value axis, so the pointer needn't be over the bar. -->
|
|
92
|
+
{@const [rangeMin, rangeMax] = valueExtentFor(marker.isHorizontal)}
|
|
93
|
+
{#if marker.isHorizontal}
|
|
94
|
+
<rect
|
|
95
|
+
class="dct-hit-area"
|
|
96
|
+
x={rangeMin + insetLeft}
|
|
97
|
+
y={bandStart + insetBottom}
|
|
98
|
+
width={Math.max(0, rangeMax - rangeMin - insetLeft - insetRight)}
|
|
99
|
+
height={Math.max(0, bandwidth - insetTop - insetBottom)}
|
|
100
|
+
fill="transparent"
|
|
101
|
+
{...events.forRow(data[0], 0)}
|
|
102
|
+
/>
|
|
120
103
|
{:else}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
height={thickness}
|
|
131
|
-
fill={marker.styles?.fill}
|
|
132
|
-
fill-opacity={marker.styles?.fillOpacity}
|
|
133
|
-
stroke={marker.styles?.stroke}
|
|
134
|
-
stroke-width={marker.styles?.strokeWidth}
|
|
135
|
-
stroke-opacity={marker.styles?.strokeOpacity}
|
|
136
|
-
stroke-dasharray={marker.styles?.strokeDasharray}
|
|
137
|
-
rx={marker.styles?.borderRadius}
|
|
138
|
-
pointer-events="none"
|
|
139
|
-
/>
|
|
140
|
-
{:else}
|
|
141
|
-
{@const thickness = Math.max(0, bandwidth - insetLeft - insetRight) + 2}
|
|
142
|
-
{@const center = bandStart + insetLeft + (bandwidth - insetLeft - insetRight) / 2}
|
|
143
|
-
<rect
|
|
144
|
-
class="hover-area"
|
|
145
|
-
x={center - thickness / 2}
|
|
146
|
-
y={valueMin}
|
|
147
|
-
width={thickness}
|
|
148
|
-
height={Math.max(0, valueMax - valueMin)}
|
|
149
|
-
fill={marker.styles?.fill}
|
|
150
|
-
fill-opacity={marker.styles?.fillOpacity}
|
|
151
|
-
stroke={marker.styles?.stroke}
|
|
152
|
-
stroke-width={marker.styles?.strokeWidth}
|
|
153
|
-
stroke-opacity={marker.styles?.strokeOpacity}
|
|
154
|
-
stroke-dasharray={marker.styles?.strokeDasharray}
|
|
155
|
-
ry={marker.styles?.borderRadius}
|
|
156
|
-
pointer-events="none"
|
|
157
|
-
/>
|
|
158
|
-
{/if}
|
|
104
|
+
<rect
|
|
105
|
+
class="dct-hit-area"
|
|
106
|
+
x={bandStart + insetLeft}
|
|
107
|
+
y={rangeMin + insetBottom}
|
|
108
|
+
width={Math.max(0, bandwidth - insetLeft - insetRight)}
|
|
109
|
+
height={Math.max(0, rangeMax - rangeMin - insetTop - insetBottom)}
|
|
110
|
+
fill="transparent"
|
|
111
|
+
{...events.forRow(data[0], 0)}
|
|
112
|
+
/>
|
|
159
113
|
{/if}
|
|
160
114
|
{/if}
|
|
161
115
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { SvelteMap } from 'svelte/reactivity';
|
|
3
4
|
import { BollingerX, BollingerY } from 'svelteplot';
|
|
4
5
|
import { usePlot } from '../../layout/plot/usePlot';
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
* the plot gives that group unless `styles` sets one.
|
|
19
20
|
*/
|
|
20
21
|
let { marker }: { marker: BollingerMarkerConfig } = $props();
|
|
22
|
+
const events = MarkerEvents.use(() => marker);
|
|
21
23
|
|
|
22
24
|
const plot = usePlot();
|
|
23
25
|
const isHorizontal = $derived(plot.axes?.isHorizontal ?? false);
|
|
@@ -47,6 +49,7 @@
|
|
|
47
49
|
{#each groups as group (group.key)}
|
|
48
50
|
{@const color = marker.grouping ? groupFill?.(group.rows[0]) : undefined}
|
|
49
51
|
<BollingerMark
|
|
52
|
+
{...events.props}
|
|
50
53
|
data={group.rows}
|
|
51
54
|
x={marker.x}
|
|
52
55
|
y={marker.y}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { BoxX, BoxY } from 'svelteplot';
|
|
3
4
|
import { usePlot } from '../../layout/plot/usePlot';
|
|
4
5
|
import { CssColor } from '../../utils/color';
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
* from `bar`.
|
|
16
17
|
*/
|
|
17
18
|
let { marker }: { marker: BoxMarkerConfig } = $props();
|
|
19
|
+
const events = MarkerEvents.use(() => marker);
|
|
18
20
|
|
|
19
21
|
const plot = usePlot();
|
|
20
22
|
const isHorizontal = $derived(plot.axes?.isHorizontal ?? false);
|
|
@@ -171,4 +173,4 @@
|
|
|
171
173
|
});
|
|
172
174
|
</script>
|
|
173
175
|
|
|
174
|
-
<BoxMark {data} x={marker.x} y={marker.y} sort={marker.sort} {...passthrough} />
|
|
176
|
+
<BoxMark {...events.props} {data} x={marker.x} y={marker.y} sort={marker.sort} {...passthrough} />
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { RowStyle } from '../utils/RowStyle';
|
|
3
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
4
|
import { Cell } from 'svelteplot';
|
|
3
5
|
import { MarkerChannels } from '../utils/MarkerChannels';
|
|
4
6
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
@@ -6,6 +8,7 @@
|
|
|
6
8
|
|
|
7
9
|
/** Renders one `'cell'` marker as a `<Cell>` call. */
|
|
8
10
|
let { marker }: { marker: CellMarkerConfig } = $props();
|
|
11
|
+
const events = MarkerEvents.use(() => marker);
|
|
9
12
|
|
|
10
13
|
const cfg = $derived(getConfiguration());
|
|
11
14
|
const data = $derived(marker.data ?? []);
|
|
@@ -13,15 +16,16 @@
|
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
18
|
<Cell
|
|
19
|
+
{...events.props}
|
|
16
20
|
{data}
|
|
17
21
|
x={marker.x}
|
|
18
22
|
y={marker.y}
|
|
19
|
-
fill={channelFill ?? marker.fill}
|
|
20
|
-
fillOpacity={marker.styles?.fillOpacity ?? 1}
|
|
21
|
-
stroke={marker.styles?.stroke}
|
|
22
|
-
strokeWidth={marker.styles?.strokeWidth ?? 0}
|
|
23
|
-
strokeOpacity={marker.styles?.strokeOpacity}
|
|
23
|
+
fill={channelFill ?? RowStyle.of(marker.styles?.fill, data)}
|
|
24
|
+
fillOpacity={RowStyle.opacity(marker.styles?.fillOpacity) ?? 1}
|
|
25
|
+
stroke={RowStyle.of(marker.styles?.stroke, data)}
|
|
26
|
+
strokeWidth={RowStyle.field(marker.styles?.strokeWidth) ?? 0}
|
|
27
|
+
strokeOpacity={RowStyle.opacity(marker.styles?.strokeOpacity)}
|
|
24
28
|
strokeDasharray={marker.styles?.strokeDasharray}
|
|
25
|
-
borderRadius={marker.styles?.borderRadius}
|
|
26
|
-
inset={marker.inset ?? 0.5}
|
|
29
|
+
borderRadius={RowStyle.field(marker.styles?.borderRadius)}
|
|
30
|
+
inset={RowStyle.field(marker.styles?.inset) ?? 0.5}
|
|
27
31
|
/>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { Contour } from 'svelteplot';
|
|
3
4
|
import type { GeoContourMarkerConfig } from '../../types/markers/geo';
|
|
4
5
|
|
|
@@ -8,10 +9,12 @@
|
|
|
8
9
|
* - this component only draws the contour itself.
|
|
9
10
|
*/
|
|
10
11
|
let { marker }: { marker: GeoContourMarkerConfig } = $props();
|
|
12
|
+
const events = MarkerEvents.use(() => marker);
|
|
11
13
|
</script>
|
|
12
14
|
|
|
13
15
|
<!-- No `?? 'none'` fallback: an unset `fill` should leave svelteplot's own default (`fill="none"`) in place, not run the literal string `'none'` through the color scale. -->
|
|
14
16
|
<Contour
|
|
17
|
+
{...events.props}
|
|
15
18
|
class="contour"
|
|
16
19
|
data={marker.data}
|
|
17
20
|
x={marker.x}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { RowStyle } from '../utils/RowStyle';
|
|
3
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
4
|
import { DelaunayLink } from 'svelteplot';
|
|
3
5
|
import { MarkerChannels } from '../utils/MarkerChannels';
|
|
4
6
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
@@ -6,6 +8,7 @@
|
|
|
6
8
|
|
|
7
9
|
/** Renders one `'delaunayLink'` marker as `<DelaunayLink>` - one line per Delaunay triangulation edge. */
|
|
8
10
|
let { marker }: { marker: DelaunayLinkMarkerConfig } = $props();
|
|
11
|
+
const events = MarkerEvents.use(() => marker);
|
|
9
12
|
|
|
10
13
|
const cfg = $derived(getConfiguration());
|
|
11
14
|
const data = $derived(marker.data ?? []);
|
|
@@ -13,14 +16,15 @@
|
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
18
|
<DelaunayLink
|
|
19
|
+
{...events.props}
|
|
16
20
|
{data}
|
|
17
21
|
x={marker.x}
|
|
18
22
|
y={marker.y}
|
|
19
23
|
z={marker.grouping}
|
|
20
|
-
fill={marker.styles?.fill}
|
|
21
|
-
fillOpacity={marker.styles?.fillOpacity}
|
|
22
|
-
stroke={marker.styles?.stroke ?? channelColor}
|
|
23
|
-
strokeWidth={marker.styles?.strokeWidth}
|
|
24
|
-
strokeOpacity={marker.styles?.strokeOpacity}
|
|
24
|
+
fill={RowStyle.of(marker.styles?.fill, data)}
|
|
25
|
+
fillOpacity={RowStyle.opacity(marker.styles?.fillOpacity)}
|
|
26
|
+
stroke={RowStyle.of(marker.styles?.stroke, data) ?? channelColor}
|
|
27
|
+
strokeWidth={RowStyle.field(marker.styles?.strokeWidth)}
|
|
28
|
+
strokeOpacity={RowStyle.opacity(marker.styles?.strokeOpacity)}
|
|
25
29
|
strokeDasharray={marker.styles?.strokeDasharray}
|
|
26
30
|
/>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { DelaunayMesh } from 'svelteplot';
|
|
3
4
|
import { MarkerChannels } from '../utils/MarkerChannels';
|
|
4
5
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
@@ -6,6 +7,7 @@
|
|
|
6
7
|
|
|
7
8
|
/** Renders one `'delaunayMesh'` marker as `<DelaunayMesh>` - the Delaunay triangulation as a single mesh. */
|
|
8
9
|
let { marker }: { marker: DelaunayMeshMarkerConfig } = $props();
|
|
10
|
+
const events = MarkerEvents.use(() => marker);
|
|
9
11
|
|
|
10
12
|
const cfg = $derived(getConfiguration());
|
|
11
13
|
const data = $derived(marker.data ?? []);
|
|
@@ -13,6 +15,7 @@
|
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
17
|
<DelaunayMesh
|
|
18
|
+
{...events.props}
|
|
16
19
|
{data}
|
|
17
20
|
x={marker.x}
|
|
18
21
|
y={marker.y}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { Density } from 'svelteplot';
|
|
3
4
|
import { SvelteMap } from 'svelte/reactivity';
|
|
4
5
|
import { MarkerChannels } from '../utils/MarkerChannels';
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
* class-based scoping every other marker kind gets from svelteplot itself.
|
|
18
19
|
*/
|
|
19
20
|
let { marker }: { marker: DensityMarkerConfig } = $props();
|
|
21
|
+
const events = MarkerEvents.use(() => marker);
|
|
20
22
|
|
|
21
23
|
const data = $derived(marker.data ?? []);
|
|
22
24
|
const cfg = $derived(getConfiguration());
|
|
@@ -47,6 +49,7 @@
|
|
|
47
49
|
|
|
48
50
|
{#each groups as group, i (i)}
|
|
49
51
|
<Density
|
|
52
|
+
{...events.props}
|
|
50
53
|
data={group.rows}
|
|
51
54
|
class="density"
|
|
52
55
|
x={marker.x}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { DifferenceY } from 'svelteplot';
|
|
3
4
|
import type { DifferenceMarkerConfig } from '../../types/markers/common';
|
|
4
5
|
|
|
@@ -9,11 +10,13 @@
|
|
|
9
10
|
* would erase them - each default is restated here instead.
|
|
10
11
|
*/
|
|
11
12
|
let { marker }: { marker: DifferenceMarkerConfig } = $props();
|
|
13
|
+
const events = MarkerEvents.use(() => marker);
|
|
12
14
|
|
|
13
15
|
const data = $derived(marker.data ?? []);
|
|
14
16
|
</script>
|
|
15
17
|
|
|
16
18
|
<DifferenceY
|
|
19
|
+
{...events.props}
|
|
17
20
|
{data}
|
|
18
21
|
x={marker.x}
|
|
19
22
|
x1={marker.x1}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts" generics="TData = Record<string, unknown>">
|
|
2
|
+
import { RowStyle } from '../utils/RowStyle';
|
|
3
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
4
|
import { Dot } from 'svelteplot';
|
|
3
5
|
import { MarkerChannels } from '../utils/MarkerChannels';
|
|
4
6
|
import { getConfiguration } from '../../configuration/config.svelte';
|
|
@@ -12,12 +14,12 @@
|
|
|
12
14
|
* `DeltaMarker` that place a dot at a computed point.
|
|
13
15
|
*/
|
|
14
16
|
const { marker }: { marker: DotMarkerConfig } = $props();
|
|
17
|
+
const events = MarkerEvents.use(() => marker);
|
|
15
18
|
|
|
16
19
|
const data = $derived((marker.data ?? []) as TData[]);
|
|
17
20
|
const x = $derived(marker.x);
|
|
18
21
|
const y = $derived(marker.y);
|
|
19
22
|
const rProp = $derived(marker.r);
|
|
20
|
-
const fillProp = $derived(marker.fill);
|
|
21
23
|
const color = $derived(marker.color ? resolveAccessor(marker.color) : undefined);
|
|
22
24
|
const opacityProp = $derived(marker.opacity ? resolveAccessor(marker.opacity) : undefined);
|
|
23
25
|
const symbolProp = $derived(marker.symbol ? resolveAccessor(marker.symbol) : undefined);
|
|
@@ -61,12 +63,14 @@
|
|
|
61
63
|
* `'none'` is handed over as unset, which svelteplot draws as no paint.
|
|
62
64
|
*/
|
|
63
65
|
const paint = <T,>(value: T): T | undefined => (value === 'none' ? undefined : value);
|
|
64
|
-
const fill = $derived(
|
|
65
|
-
|
|
66
|
+
const fill = $derived(
|
|
67
|
+
paint(resolvedFill ?? RowStyle.of(styles?.dotFill, displayData) ?? 'currentColor')
|
|
68
|
+
);
|
|
69
|
+
const flatFillOpacity = $derived(RowStyle.opacity(styles?.dotFillOpacity) ?? 1);
|
|
66
70
|
const symbol = $derived(resolvedSymbolFn ?? styles?.dotSymbol ?? 'circle');
|
|
67
|
-
const stroke = $derived(paint(styles?.dotStroke ?? 'currentColor'));
|
|
68
|
-
const strokeWidth = $derived(styles?.dotStrokeWidth ?? 1);
|
|
69
|
-
const strokeOpacity = $derived(styles?.dotStrokeOpacity ?? 1);
|
|
71
|
+
const stroke = $derived(paint(RowStyle.of(styles?.dotStroke, displayData) ?? 'currentColor'));
|
|
72
|
+
const strokeWidth = $derived(RowStyle.field(styles?.dotStrokeWidth) ?? 1);
|
|
73
|
+
const strokeOpacity = $derived(RowStyle.opacity(styles?.dotStrokeOpacity) ?? 1);
|
|
70
74
|
const strokeDasharray = $derived(styles?.dotStrokeDasharray);
|
|
71
75
|
</script>
|
|
72
76
|
|
|
@@ -74,6 +78,7 @@
|
|
|
74
78
|
<RowOffsetMarks {marker} {rows}>
|
|
75
79
|
{#snippet mark(own)}
|
|
76
80
|
<Dot
|
|
81
|
+
{...events.props}
|
|
77
82
|
data={own}
|
|
78
83
|
x={x ?? 0}
|
|
79
84
|
y={y ?? 0}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { Graticule } from 'svelteplot';
|
|
3
4
|
import type { GeoGraticuleMarkerConfig } from '../../types/markers/geo';
|
|
4
5
|
|
|
5
6
|
/** Renders one `'graticule'` marker - longitude/latitude gridlines. */
|
|
6
7
|
let { marker }: { marker: GeoGraticuleMarkerConfig } = $props();
|
|
8
|
+
const events = MarkerEvents.use(() => marker);
|
|
7
9
|
</script>
|
|
8
10
|
|
|
9
11
|
<Graticule
|
|
12
|
+
{...events.props}
|
|
10
13
|
step={marker.step}
|
|
11
14
|
stepX={marker.stepX}
|
|
12
15
|
stepY={marker.stepY}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { MarkerEvents } from '../utils/MarkerEvents';
|
|
2
3
|
import { Sphere } from 'svelteplot';
|
|
3
4
|
import type { GeoSphereMarkerConfig } from '../../types/markers/geo';
|
|
4
5
|
|
|
5
6
|
/** Renders one `'sphere'` marker - the outer globe outline. */
|
|
6
7
|
let { marker }: { marker: GeoSphereMarkerConfig } = $props();
|
|
8
|
+
const events = MarkerEvents.use(() => marker);
|
|
7
9
|
</script>
|
|
8
10
|
|
|
9
11
|
<Sphere
|
|
12
|
+
{...events.props}
|
|
10
13
|
fill={marker.styles?.fill}
|
|
11
14
|
fillOpacity={marker.styles?.fillOpacity}
|
|
12
15
|
stroke={marker.styles?.stroke ?? 'currentColor'}
|