@fundar/data-chart-telling 0.0.25 → 0.0.27
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/dist/charts/BaseChart.svelte +18 -10
- package/dist/charts/BaseChart.svelte.d.ts +4 -2
- package/dist/charts/bar/Chart.svelte +2 -0
- package/dist/charts/heatmap/Chart.svelte +5 -3
- package/dist/charts/heatmap/Chart.svelte.d.ts +1 -2
- package/dist/charts/line/Chart.svelte +2 -0
- package/dist/charts/pyramid/Chart.svelte +5 -3
- package/dist/charts/pyramid/Chart.svelte.d.ts +1 -2
- package/dist/charts/scatter/Chart.svelte +95 -0
- package/dist/charts/scatter/Chart.svelte.d.ts +28 -0
- package/dist/configuration/config.svelte.js +28 -0
- package/dist/configuration/themes/dark.js +4 -0
- package/dist/configuration/themes/index.d.ts +112 -0
- package/dist/index.d.ts +26 -16
- package/dist/index.js +11 -3
- package/dist/layout/coordinates/CoordinatesLayout.svelte +93 -0
- package/dist/layout/{plot/RuleLayout.svelte.d.ts → coordinates/CoordinatesLayout.svelte.d.ts} +13 -16
- package/dist/layout/coordinates/margins.d.ts +16 -0
- package/dist/layout/coordinates/margins.js +11 -0
- package/dist/{plots/geo → layout/coordinates}/projections/argentina.d.ts +1 -1
- package/dist/layout/{geo → coordinates}/resolveProjection.d.ts +1 -1
- package/dist/layout/coordinates/resolveProjection.js +24 -0
- package/dist/{plots/geo → layout/coordinates}/zoom.svelte.d.ts +1 -1
- package/dist/layout/facet/FacetIndicator.svelte +31 -0
- package/dist/layout/facet/FacetIndicator.svelte.d.ts +8 -0
- package/dist/layout/facet/FacetLayout.svelte +249 -24
- package/dist/layout/facet/FacetLayout.svelte.d.ts +7 -1
- package/dist/layout/geometry/GeometryLayout.svelte +231 -0
- package/dist/layout/geometry/GeometryLayout.svelte.d.ts +62 -0
- package/dist/layout/legend/ContinuousSection.svelte +1 -1
- package/dist/layout/legend/ContinuousSection.svelte.d.ts +1 -1
- package/dist/layout/legend/DiscreteSection.svelte +1 -1
- package/dist/layout/legend/DiscreteSection.svelte.d.ts +1 -1
- package/dist/layout/legend/LegendLayout.svelte +1 -1
- package/dist/layout/legend/LegendLayout.svelte.d.ts +1 -1
- package/dist/layout/legend/interaction.svelte.d.ts +9 -1
- package/dist/layout/legend/interaction.svelte.js +9 -1
- package/dist/layout/plot/BasePlotLayout.svelte +142 -155
- package/dist/layout/plot/BasePlotLayout.svelte.d.ts +61 -51
- package/dist/layout/plot/margins.d.ts +0 -16
- package/dist/layout/plot/margins.js +0 -11
- package/dist/layout/{plot/AxisLayout.svelte → scales/ScalesLayout.svelte} +23 -16
- package/dist/layout/{plot/AxisLayout.svelte.d.ts → scales/ScalesLayout.svelte.d.ts} +4 -5
- package/dist/layout/scales/buildScale.d.ts +8 -0
- package/dist/layout/scales/buildScale.js +43 -0
- package/dist/layout/styles/StylesLayout.svelte +75 -0
- package/dist/layout/styles/StylesLayout.svelte.d.ts +15 -0
- package/dist/{plots/geo → layout/styles}/TileLayer.svelte +2 -2
- package/dist/{plots/geo → layout/styles}/TileLayer.svelte.d.ts +1 -1
- package/dist/layout/timeline/Timeline.svelte +1 -1
- package/dist/layout/timeline/Timeline.svelte.d.ts +1 -1
- package/dist/layout/timeline/TimelineLayout.svelte +1 -1
- package/dist/layout/timeline/TimelineLayout.svelte.d.ts +1 -1
- package/dist/layout/tooltip/Tooltip.svelte +16 -20
- package/dist/layout/tooltip/Tooltip.svelte.d.ts +5 -0
- package/dist/layout/tooltip/TooltipLayout.svelte +7 -1
- package/dist/layout/tooltip/TooltipLayout.svelte.d.ts +4 -0
- package/dist/layout/tooltip/controller.svelte.d.ts +4 -5
- package/dist/layout/tooltip/controller.svelte.js +42 -16
- package/dist/layout/tooltip/resolveTooltipPlacement.d.ts +24 -0
- package/dist/layout/tooltip/resolveTooltipPlacement.js +49 -0
- package/dist/layout/tooltip/utils.d.ts +27 -19
- package/dist/layout/tooltip/utils.js +16 -15
- package/dist/markers/BarMarker.svelte +92 -0
- package/dist/markers/BarMarker.svelte.d.ts +7 -0
- package/dist/markers/CellMarker.svelte +21 -0
- package/dist/markers/CellMarker.svelte.d.ts +7 -0
- package/dist/markers/ContourMarker.svelte +28 -0
- package/dist/markers/ContourMarker.svelte.d.ts +7 -0
- package/dist/markers/DeltaMarker.svelte +32 -39
- package/dist/markers/DeltaMarker.svelte.d.ts +4 -5
- package/dist/markers/DotMarker.svelte +35 -6
- package/dist/markers/DotMarker.svelte.d.ts +11 -2
- package/dist/markers/GeoFeaturesMarker.svelte +19 -0
- package/dist/markers/GeoFeaturesMarker.svelte.d.ts +7 -0
- package/dist/markers/GeoHoverMarker.svelte +25 -0
- package/dist/markers/GeoHoverMarker.svelte.d.ts +9 -0
- package/dist/markers/GraticuleMarker.svelte +18 -0
- package/dist/markers/GraticuleMarker.svelte.d.ts +7 -0
- package/dist/markers/HoverMarker.svelte +34 -35
- package/dist/markers/HoverMarker.svelte.d.ts +15 -9
- package/dist/markers/LineMarker.svelte +19 -0
- package/dist/markers/LineMarker.svelte.d.ts +7 -0
- package/dist/markers/LinkMarker.svelte +42 -0
- package/dist/markers/LinkMarker.svelte.d.ts +7 -0
- package/dist/markers/RuleMarker.svelte +24 -0
- package/dist/markers/RuleMarker.svelte.d.ts +10 -0
- package/dist/markers/SphereMarker.svelte +15 -0
- package/dist/markers/SphereMarker.svelte.d.ts +7 -0
- package/dist/markers/TextMarker.svelte +1 -1
- package/dist/markers/TextMarker.svelte.d.ts +1 -1
- package/dist/markers/VectorMarker.svelte +20 -0
- package/dist/markers/VectorMarker.svelte.d.ts +7 -0
- package/dist/markers/inset/InsetMarker.svelte +38 -45
- package/dist/markers/inset/InsetMarker.svelte.d.ts +6 -2
- package/dist/plots/bar/Plot.svelte +96 -87
- package/dist/plots/bar/Plot.svelte.d.ts +4 -5
- package/dist/plots/bar/ValueLabels.svelte +70 -24
- package/dist/plots/bar/ValueLabels.svelte.d.ts +11 -2
- package/dist/plots/bar/buildBarMarkers.d.ts +30 -0
- package/dist/plots/bar/buildBarMarkers.js +100 -0
- package/dist/plots/bar/layout.svelte.d.ts +1 -2
- package/dist/plots/bar/layout.svelte.js +1 -1
- package/dist/plots/geo/Plot.svelte +113 -387
- package/dist/plots/geo/Plot.svelte.d.ts +5 -4
- package/dist/plots/geo/buildGeoMarkers.d.ts +33 -0
- package/dist/plots/geo/buildGeoMarkers.js +47 -0
- package/dist/plots/heatmap/Plot.svelte +27 -52
- package/dist/plots/heatmap/Plot.svelte.d.ts +4 -5
- package/dist/plots/heatmap/ValueLabels.svelte +5 -5
- package/dist/plots/heatmap/ValueLabels.svelte.d.ts +3 -3
- package/dist/plots/heatmap/buildCellMarkers.d.ts +21 -0
- package/dist/plots/heatmap/buildCellMarkers.js +25 -0
- package/dist/plots/line/Plot.svelte +73 -141
- package/dist/plots/line/Plot.svelte.d.ts +4 -4
- package/dist/plots/line/ValueLabels.svelte +84 -85
- package/dist/plots/line/ValueLabels.svelte.d.ts +10 -1
- package/dist/plots/line/buildLineMarkers.d.ts +15 -0
- package/dist/plots/line/buildLineMarkers.js +57 -0
- package/dist/plots/pyramid/Plot.svelte +80 -121
- package/dist/plots/pyramid/Plot.svelte.d.ts +4 -5
- package/dist/plots/pyramid/ValueLabels.svelte +71 -25
- package/dist/plots/pyramid/ValueLabels.svelte.d.ts +11 -2
- package/dist/plots/pyramid/buildPyramidBarMarkers.d.ts +19 -0
- package/dist/plots/pyramid/buildPyramidBarMarkers.js +32 -0
- package/dist/plots/scatter/Plot.svelte +242 -0
- package/dist/{layout/plot/GridLayout.svelte.d.ts → plots/scatter/Plot.svelte.d.ts} +9 -7
- package/dist/plots/scatter/ValueLabels.svelte +149 -0
- package/dist/plots/{bar/BarSegments.svelte.d.ts → scatter/ValueLabels.svelte.d.ts} +17 -15
- package/dist/plots/scatter/buildScatterMarkers.d.ts +11 -0
- package/dist/plots/scatter/buildScatterMarkers.js +37 -0
- package/dist/plots/scatter/resolveRadiusPaddedDomain.d.ts +10 -0
- package/dist/plots/scatter/resolveRadiusPaddedDomain.js +23 -0
- package/dist/plots/utils/declutter.d.ts +55 -37
- package/dist/plots/utils/declutter.js +79 -64
- package/dist/plots/utils/geoAccessors.d.ts +1 -1
- package/dist/plots/utils/geoAccessors.js +1 -1
- package/dist/plots/utils/labelOverflow.svelte.d.ts +51 -0
- package/dist/plots/utils/labelOverflow.svelte.js +116 -0
- package/dist/plots/utils/legendDisabled.d.ts +1 -1
- package/dist/plots/utils/segments.d.ts +17 -10
- package/dist/plots/utils/segments.js +26 -16
- package/dist/types/charts/common.d.ts +3 -50
- package/dist/types/charts/props.d.ts +8 -8
- package/dist/types/configuration/styling.d.ts +26 -2
- package/dist/types/{plots/scales/geo.d.ts → layout/coordinates.d.ts} +33 -1
- package/dist/types/layout/facet.d.ts +41 -0
- package/dist/types/layout/geometry.d.ts +17 -0
- package/dist/types/layout/legend.d.ts +65 -1
- package/dist/types/{plots/axis.d.ts → layout/scales.d.ts} +11 -0
- package/dist/types/layout/styles.d.ts +115 -0
- package/dist/types/layout/timeline.d.ts +32 -0
- package/dist/types/layout/tooltip.d.ts +20 -1
- package/dist/types/markers/all.d.ts +11 -0
- package/dist/types/markers/all.js +1 -0
- package/dist/types/markers/base.d.ts +45 -0
- package/dist/types/markers/base.js +1 -0
- package/dist/types/markers/common.d.ts +64 -16
- package/dist/types/markers/geo.d.ts +75 -100
- package/dist/types/markers/line.d.ts +34 -0
- package/dist/types/markers/line.js +1 -0
- package/dist/types/markers/props.d.ts +1 -1
- package/dist/types/plots/data/common.d.ts +1 -1
- package/dist/types/plots/data/scatter.d.ts +13 -0
- package/dist/types/plots/data/scatter.js +1 -0
- package/dist/types/plots/props.d.ts +46 -74
- package/dist/types/plots/segments/common.d.ts +6 -12
- package/dist/types/plots/segments/config.d.ts +1 -1
- package/dist/types/plots/styling.d.ts +10 -0
- package/dist/{plots/utils → utils}/delta.d.ts +2 -2
- package/dist/{plots/utils → utils}/delta.js +1 -1
- package/dist/utils/edgeAwareAnchor.d.ts +37 -0
- package/dist/utils/edgeAwareAnchor.js +65 -0
- package/dist/utils/grouping.d.ts +1 -1
- package/dist/utils/interpolate.d.ts +2 -2
- package/package.json +3 -1
- package/dist/layout/geo/GeoLayout.svelte +0 -51
- package/dist/layout/geo/GeoLayout.svelte.d.ts +0 -24
- package/dist/layout/geo/resolveProjection.js +0 -48
- package/dist/layout/plot/GridLayout.svelte +0 -30
- package/dist/layout/plot/RuleLayout.svelte +0 -111
- package/dist/plots/bar/BarSegments.svelte +0 -69
- package/dist/types/charts/legend.d.ts +0 -60
- package/dist/types/plots/delta.d.ts +0 -19
- package/dist/types/plots/styles/common.d.ts +0 -52
- package/dist/types/plots/styles/geo.d.ts +0 -42
- /package/dist/{plots/geo → layout/coordinates}/projections/argentina.js +0 -0
- /package/dist/{plots/geo → layout/coordinates}/projections/fit.d.ts +0 -0
- /package/dist/{plots/geo → layout/coordinates}/projections/fit.js +0 -0
- /package/dist/{plots/geo → layout/coordinates}/rotate.svelte.d.ts +0 -0
- /package/dist/{plots/geo → layout/coordinates}/rotate.svelte.js +0 -0
- /package/dist/{plots/geo → layout/coordinates}/zoom.svelte.js +0 -0
- /package/dist/types/{charts/legend.js → layout/coordinates.js} +0 -0
- /package/dist/types/{plots/axis.js → layout/facet.js} +0 -0
- /package/dist/types/{plots/delta.js → layout/geometry.js} +0 -0
- /package/dist/types/{plots/scales/geo.js → layout/scales.js} +0 -0
- /package/dist/types/{plots/styles/common.js → layout/styles.js} +0 -0
- /package/dist/types/{plots/styles/geo.js → layout/timeline.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as BarPlot } from './plots/bar/Plot.svelte';
|
|
|
4
4
|
export { default as HeatmapPlot } from './plots/heatmap/Plot.svelte';
|
|
5
5
|
export { default as LinePlot } from './plots/line/Plot.svelte';
|
|
6
6
|
export { default as PyramidPlot } from './plots/pyramid/Plot.svelte';
|
|
7
|
+
export { default as ScatterPlot } from './plots/scatter/Plot.svelte';
|
|
7
8
|
export { default as GeoPlot } from './plots/geo/Plot.svelte';
|
|
8
9
|
// ── Charts ──────────────────────────────────────────────────────────────────
|
|
9
10
|
// High-level, plot-agnostic chrome plus ready-made chart kinds.
|
|
@@ -12,23 +13,30 @@ export { default as BarChart } from './charts/bar/Chart.svelte';
|
|
|
12
13
|
export { default as HeatmapChart } from './charts/heatmap/Chart.svelte';
|
|
13
14
|
export { default as LineChart } from './charts/line/Chart.svelte';
|
|
14
15
|
export { default as PyramidChart } from './charts/pyramid/Chart.svelte';
|
|
16
|
+
export { default as ScatterChart } from './charts/scatter/Chart.svelte';
|
|
15
17
|
// Interchangeable layout primitives (compose your own chart kinds with these).
|
|
16
18
|
export { default as ChartContainer } from './charts/container/ChartContainer.svelte';
|
|
17
19
|
export { default as BasePlotLayout } from './layout/plot/BasePlotLayout.svelte';
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as TileLayer } from './
|
|
20
|
+
export { default as CoordinatesLayout } from './layout/coordinates/CoordinatesLayout.svelte';
|
|
21
|
+
export { default as TileLayer } from './layout/styles/TileLayer.svelte';
|
|
20
22
|
// Custom geo projections — usable as `scales.projection.type`.
|
|
21
|
-
export { argentinaBicontinental } from './
|
|
23
|
+
export { argentinaBicontinental } from './layout/coordinates/projections/argentina';
|
|
22
24
|
export { default as Timeline } from './layout/timeline/Timeline.svelte';
|
|
23
25
|
export { default as TimelineLayout } from './layout/timeline/TimelineLayout.svelte';
|
|
24
26
|
export { default as FacetLayout } from './layout/facet/FacetLayout.svelte';
|
|
27
|
+
export { default as FacetIndicator } from './layout/facet/FacetIndicator.svelte';
|
|
25
28
|
export { default as LegendLayout } from './layout/legend/LegendLayout.svelte';
|
|
26
29
|
export { default as Tooltip } from './layout/tooltip/Tooltip.svelte';
|
|
30
|
+
export { getLegendInteraction, provideLegendInteraction, createLegendInteraction, } from './layout/legend/interaction.svelte';
|
|
27
31
|
// Markers
|
|
32
|
+
export { default as BarMarker } from './markers/BarMarker.svelte';
|
|
33
|
+
export { default as CellMarker } from './markers/CellMarker.svelte';
|
|
28
34
|
export { default as DeltaMarker } from './markers/DeltaMarker.svelte';
|
|
29
35
|
export { default as DotMarker } from './markers/DotMarker.svelte';
|
|
30
36
|
export { default as HoverMarker } from './markers/HoverMarker.svelte';
|
|
37
|
+
export { default as LineMarker } from './markers/LineMarker.svelte';
|
|
31
38
|
export { default as PeakMarker } from './markers/PeakMarker.svelte';
|
|
39
|
+
export { default as RuleMarker } from './markers/RuleMarker.svelte';
|
|
32
40
|
export { default as TextMarker } from './markers/TextMarker.svelte';
|
|
33
41
|
export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG, } from './configuration/config.svelte';
|
|
34
42
|
export { THEMES } from './configuration/themes';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts" generics="TData extends Record<string, unknown>">
|
|
2
|
+
import type { ComponentProps, Snippet } from 'svelte';
|
|
3
|
+
import { Plot } from 'svelteplot';
|
|
4
|
+
import { resolveProjection } from './resolveProjection';
|
|
5
|
+
import { createGeoZoom } from './zoom.svelte';
|
|
6
|
+
import { createGeoRotate, type GeoRotate } from './rotate.svelte';
|
|
7
|
+
import type { CoordinatesConfig } from '../../types/layout/coordinates';
|
|
8
|
+
|
|
9
|
+
type SveltePlotProps = ComponentProps<typeof Plot>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The Coordinates layer, rendered — resolves the active coordinate system
|
|
13
|
+
* (today, only a `d3-geo` projection; svelteplot has no other coordinate
|
|
14
|
+
* abstraction, cartesian is implicit elsewhere) and owns `<Plot>` itself,
|
|
15
|
+
* since `<Plot projection>` must be known before `<Plot>` mounts — nothing
|
|
16
|
+
* nested inside it could supply that prop after the fact. Also owns the
|
|
17
|
+
* pan/zoom/rotate gesture state and applies the resulting transform as a
|
|
18
|
+
* `<g>` wrapper around `children`. A no-op identity transform, no
|
|
19
|
+
* projection, for every plot kind but `GeoPlot`.
|
|
20
|
+
*/
|
|
21
|
+
let {
|
|
22
|
+
width,
|
|
23
|
+
height,
|
|
24
|
+
margin,
|
|
25
|
+
x,
|
|
26
|
+
y,
|
|
27
|
+
coordinates = undefined,
|
|
28
|
+
data,
|
|
29
|
+
containerEl,
|
|
30
|
+
children,
|
|
31
|
+
}: {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
margin: SveltePlotProps['margin'];
|
|
35
|
+
x: SveltePlotProps['x'];
|
|
36
|
+
y: SveltePlotProps['y'];
|
|
37
|
+
coordinates?: CoordinatesConfig;
|
|
38
|
+
/** Fed to `resolveProjection`'s `domain: 'data'` sentinel — the same rows `BasePlotLayout` uses for hover matching. */
|
|
39
|
+
data: TData[];
|
|
40
|
+
containerEl?: HTMLDivElement;
|
|
41
|
+
children: Snippet;
|
|
42
|
+
} = $props();
|
|
43
|
+
|
|
44
|
+
const resolvedProjection = $derived(resolveProjection(coordinates?.projection, data));
|
|
45
|
+
|
|
46
|
+
const zoomEnabled = $derived(coordinates?.zoom !== false && coordinates?.zoom != null);
|
|
47
|
+
const zoomConfig = $derived(typeof coordinates?.zoom === 'object' ? coordinates.zoom : undefined);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Orthographic (and other azimuthal, hemisphere-style) projections don't
|
|
51
|
+
* gain anything from drag-to-*pan* — panning just slides the same globe a
|
|
52
|
+
* few pixels within the frame — so when zoom is enabled on one, drag
|
|
53
|
+
* instead rotates the globe (`createGeoRotate`) and wheel/pinch keeps
|
|
54
|
+
* scaling it (`createGeoZoom`, with its own drag disabled below so the two
|
|
55
|
+
* gestures don't fight over the same pointer events).
|
|
56
|
+
*/
|
|
57
|
+
const projectionType = $derived(
|
|
58
|
+
typeof resolvedProjection === 'string' ? resolvedProjection : resolvedProjection?.type,
|
|
59
|
+
);
|
|
60
|
+
const rotateEnabled = $derived(zoomEnabled && projectionType === 'orthographic');
|
|
61
|
+
const baseRotate = $derived.by((): GeoRotate => {
|
|
62
|
+
const configured = typeof resolvedProjection === 'object' ? resolvedProjection?.rotate : undefined;
|
|
63
|
+
return [configured?.[0] ?? 0, configured?.[1] ?? 0, configured?.[2] ?? 0];
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const geoZoom = createGeoZoom({
|
|
67
|
+
enabled: () => zoomEnabled,
|
|
68
|
+
config: () => zoomConfig,
|
|
69
|
+
node: () => containerEl ?? null,
|
|
70
|
+
disableDrag: () => rotateEnabled,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const geoRotate = createGeoRotate({
|
|
74
|
+
enabled: () => rotateEnabled,
|
|
75
|
+
baseRotate: () => baseRotate,
|
|
76
|
+
scale: () => geoZoom.transform.k,
|
|
77
|
+
node: () => containerEl ?? null,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const finalProjection = $derived.by(() => {
|
|
81
|
+
if (!rotateEnabled) return resolvedProjection;
|
|
82
|
+
return {
|
|
83
|
+
...(typeof resolvedProjection === 'string' ? { type: resolvedProjection } : resolvedProjection),
|
|
84
|
+
rotate: geoRotate.rotate,
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<Plot {width} {height} {margin} {x} {y} projection={finalProjection as SveltePlotProps['projection']}>
|
|
90
|
+
<g transform="translate({geoZoom.transform.x}, {geoZoom.transform.y}) scale({geoZoom.transform.k})">
|
|
91
|
+
{@render children()}
|
|
92
|
+
</g>
|
|
93
|
+
</Plot>
|
package/dist/layout/{plot/RuleLayout.svelte.d.ts → coordinates/CoordinatesLayout.svelte.d.ts}
RENAMED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type {
|
|
3
|
-
import type { Series } from '../../types/plots/data/common';
|
|
4
|
-
import type { Marker } from '../../types/markers/common';
|
|
5
|
-
import type { HoverPoint } from '../../types/layout/tooltip';
|
|
2
|
+
import type { CoordinatesConfig } from '../../types/layout/coordinates';
|
|
6
3
|
declare function $$render<TData extends Record<string, unknown>>(): {
|
|
7
4
|
props: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
margin: number | "auto" | import("svelteplot/types/plot.js").PlotMargin | undefined;
|
|
8
|
+
x: false | import("svelteplot/types/data.js").RawValue[] | Partial<import("svelteplot/types/scale.js").XScaleOptions> | undefined;
|
|
9
|
+
y: false | import("svelteplot/types/data.js").RawValue[] | Partial<import("svelteplot/types/scale.js").YScaleOptions> | undefined;
|
|
10
|
+
coordinates?: CoordinatesConfig;
|
|
11
|
+
/** Fed to `resolveProjection`'s `domain: 'data'` sentinel — the same rows `BasePlotLayout` uses for hover matching. */
|
|
12
|
+
data: TData[];
|
|
13
|
+
containerEl?: HTMLDivElement;
|
|
17
14
|
children: Snippet;
|
|
18
15
|
};
|
|
19
16
|
exports: {};
|
|
@@ -35,6 +32,6 @@ interface $$IsomorphicComponent {
|
|
|
35
32
|
<TData extends Record<string, unknown>>(internal: unknown, props: ReturnType<__sveltets_Render<TData>['props']> & {}): ReturnType<__sveltets_Render<TData>['exports']>;
|
|
36
33
|
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
37
34
|
}
|
|
38
|
-
declare const
|
|
39
|
-
type
|
|
40
|
-
export default
|
|
35
|
+
declare const CoordinatesLayout: $$IsomorphicComponent;
|
|
36
|
+
type CoordinatesLayout<TData extends Record<string, unknown>> = InstanceType<typeof CoordinatesLayout<TData>>;
|
|
37
|
+
export default CoordinatesLayout;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GeoPlot's own margin default — a small, uniform gap on every side, unlike
|
|
3
|
+
* `AUTO_MARGIN_ESTIMATE`'s asymmetric axis-tick-label estimate (extra room
|
|
4
|
+
* on the left/bottom for y tick labels and an x-axis title). A map has no
|
|
5
|
+
* axes to make room for, so borrowing that estimate just left GeoPlot with
|
|
6
|
+
* a lopsided, oversized margin — most visibly a much taller gap under the
|
|
7
|
+
* map than an `inset` marker's own default `margin` (see `insetLayout.ts`),
|
|
8
|
+
* even though both are meant to read as the same edge gap. Matching this
|
|
9
|
+
* constant to that 8px inset default keeps the two visually aligned.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GEO_MARGIN_ESTIMATE: {
|
|
12
|
+
readonly top: 8;
|
|
13
|
+
readonly right: 8;
|
|
14
|
+
readonly bottom: 8;
|
|
15
|
+
readonly left: 8;
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GeoPlot's own margin default — a small, uniform gap on every side, unlike
|
|
3
|
+
* `AUTO_MARGIN_ESTIMATE`'s asymmetric axis-tick-label estimate (extra room
|
|
4
|
+
* on the left/bottom for y tick labels and an x-axis title). A map has no
|
|
5
|
+
* axes to make room for, so borrowing that estimate just left GeoPlot with
|
|
6
|
+
* a lopsided, oversized margin — most visibly a much taller gap under the
|
|
7
|
+
* map than an `inset` marker's own default `margin` (see `insetLayout.ts`),
|
|
8
|
+
* even though both are meant to read as the same edge gap. Matching this
|
|
9
|
+
* constant to that 8px inset default keeps the two visually aligned.
|
|
10
|
+
*/
|
|
11
|
+
export const GEO_MARGIN_ESTIMATE = { top: 8, right: 8, bottom: 8, left: 8 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeoCustomProjectionFactory } from '../../../types/
|
|
1
|
+
import type { GeoCustomProjectionFactory } from '../../../types/layout/coordinates';
|
|
2
2
|
/**
|
|
3
3
|
* Argentina's territory in one unbroken frame: the mainland and the
|
|
4
4
|
* Antarctic/South Atlantic sector both visible, related to each other at
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GeoProjectionConfig } from '../../types/
|
|
1
|
+
import type { GeoProjectionConfig } from '../../types/layout/coordinates';
|
|
2
2
|
/**
|
|
3
3
|
* Resolves a `GeoScalesConfig['projection']` into what svelteplot's own
|
|
4
4
|
* `<Plot projection>` expects — kept separate from `GeoPlot`'s own
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a `GeoScalesConfig['projection']` into what svelteplot's own
|
|
3
|
+
* `<Plot projection>` expects — kept separate from `GeoPlot`'s own
|
|
4
|
+
* `Plot.svelte` so adding more projection-level behavior (like the
|
|
5
|
+
* `domain: 'data'` sentinel below) doesn't grow that component itself.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveProjection(projection, data) {
|
|
8
|
+
if (!projection)
|
|
9
|
+
return 'equal-earth';
|
|
10
|
+
if (typeof projection === 'string')
|
|
11
|
+
return projection;
|
|
12
|
+
const domain = projection.domain === 'data'
|
|
13
|
+
? { type: 'FeatureCollection', features: data }
|
|
14
|
+
: projection.domain;
|
|
15
|
+
return {
|
|
16
|
+
type: projection.type,
|
|
17
|
+
rotate: projection.rotate,
|
|
18
|
+
center: projection.center,
|
|
19
|
+
parallels: projection.parallels,
|
|
20
|
+
inset: projection.inset,
|
|
21
|
+
clip: projection.clip,
|
|
22
|
+
domain,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Default position badge for `carousel`/`paginated` facet modes. Styled from
|
|
4
|
+
* the `--dct-facet-indicator-*` config vars; positioning is owned by the
|
|
5
|
+
* parent that renders it.
|
|
6
|
+
*/
|
|
7
|
+
let {
|
|
8
|
+
current,
|
|
9
|
+
total,
|
|
10
|
+
format,
|
|
11
|
+
}: {
|
|
12
|
+
current: number;
|
|
13
|
+
total: number;
|
|
14
|
+
format?: (current: number, total: number) => string;
|
|
15
|
+
} = $props();
|
|
16
|
+
|
|
17
|
+
const text = $derived(format ? format(current, total) : `${current} / ${total}`);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="dct-facet-indicator">{text}</div>
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
.dct-facet-indicator {
|
|
24
|
+
padding: var(--dct-facet-indicator-pad, 0.125rem 0.5rem);
|
|
25
|
+
border-radius: var(--dct-facet-indicator-radius, 999px);
|
|
26
|
+
font-size: var(--dct-facet-indicator-size, 0.8125rem);
|
|
27
|
+
background: var(--dct-facet-indicator-bg, #111827);
|
|
28
|
+
color: var(--dct-facet-indicator-color, #fff);
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
current: number;
|
|
3
|
+
total: number;
|
|
4
|
+
format?: (current: number, total: number) => string;
|
|
5
|
+
};
|
|
6
|
+
declare const FacetIndicator: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type FacetIndicator = ReturnType<typeof FacetIndicator>;
|
|
8
|
+
export default FacetIndicator;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
<script lang="ts" generics="TRow extends Record<string, unknown>">
|
|
2
2
|
import { isMobile } from '../../stores/device';
|
|
3
3
|
import { groupBy } from '../../utils/grouping';
|
|
4
|
+
import FacetIndicator from './FacetIndicator.svelte';
|
|
4
5
|
import type {
|
|
5
6
|
FacetColumns,
|
|
7
|
+
FacetMode,
|
|
8
|
+
Responsive,
|
|
6
9
|
FacetCellSnippet,
|
|
7
|
-
|
|
10
|
+
FacetIndicatorSnippet,
|
|
11
|
+
FacetNavSnippet,
|
|
12
|
+
FacetNavDirection,
|
|
13
|
+
} from '../../types/layout/facet';
|
|
8
14
|
import type { Accessor } from '../../types/plots/data/common';
|
|
9
15
|
|
|
10
16
|
/**
|
|
11
|
-
* Small-multiples layout. It splits the data by `by
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
17
|
+
* Small-multiples layout. It splits the data by `by` and hands each group to
|
|
18
|
+
* the `cell` snippet with its own measured box. Like the other primitives it
|
|
19
|
+
* never draws the plot itself — any plot that accepts `{ data, width, height }`
|
|
20
|
+
* can be faceted.
|
|
21
|
+
*
|
|
22
|
+
* `mode` picks how the groups are arranged: `'grid'` (default) lays them all
|
|
23
|
+
* out at once; `'paginated'` pages through the same grid in fixed chunks;
|
|
24
|
+
* `'carousel'` shows `visible` groups at a time with touch-drag/snap.
|
|
15
25
|
*/
|
|
16
26
|
let {
|
|
17
27
|
data,
|
|
@@ -19,6 +29,12 @@
|
|
|
19
29
|
columns = { desktop: 3, mobile: 1 },
|
|
20
30
|
values,
|
|
21
31
|
gap = 12,
|
|
32
|
+
mode = 'grid',
|
|
33
|
+
visible = 1,
|
|
34
|
+
pageSize,
|
|
35
|
+
formatIndicator,
|
|
36
|
+
indicator,
|
|
37
|
+
navButton,
|
|
22
38
|
width,
|
|
23
39
|
height,
|
|
24
40
|
cell,
|
|
@@ -28,11 +44,24 @@
|
|
|
28
44
|
columns?: FacetColumns;
|
|
29
45
|
values?: string[];
|
|
30
46
|
gap?: number;
|
|
47
|
+
mode?: Responsive<FacetMode>;
|
|
48
|
+
visible?: number;
|
|
49
|
+
pageSize?: number;
|
|
50
|
+
formatIndicator?: (current: number, total: number) => string;
|
|
51
|
+
indicator?: FacetIndicatorSnippet;
|
|
52
|
+
navButton?: FacetNavSnippet;
|
|
31
53
|
width: number;
|
|
32
54
|
height: number;
|
|
33
55
|
cell: FacetCellSnippet<TRow>;
|
|
34
56
|
} = $props();
|
|
35
57
|
|
|
58
|
+
function resolveResponsive<T>(value: Responsive<T>, mobile: boolean): T {
|
|
59
|
+
if (typeof value === 'object' && value !== null && 'desktop' in value) {
|
|
60
|
+
return mobile ? (value as { desktop: T; mobile: T }).mobile : (value as { desktop: T; mobile: T }).desktop;
|
|
61
|
+
}
|
|
62
|
+
return value as T;
|
|
63
|
+
}
|
|
64
|
+
|
|
36
65
|
const groups = $derived(groupBy(data, by));
|
|
37
66
|
|
|
38
67
|
const entries = $derived.by((): [string, TRow[]][] => {
|
|
@@ -42,13 +71,10 @@
|
|
|
42
71
|
.map((v) => [v, groups.get(v)!] as [string, TRow[]]);
|
|
43
72
|
});
|
|
44
73
|
|
|
74
|
+
const resolvedMode = $derived(resolveResponsive(mode, $isMobile));
|
|
75
|
+
|
|
45
76
|
const cols = $derived.by(() => {
|
|
46
|
-
const desired =
|
|
47
|
-
typeof columns === 'number'
|
|
48
|
-
? columns
|
|
49
|
-
: $isMobile
|
|
50
|
-
? columns.mobile
|
|
51
|
-
: columns.desktop;
|
|
77
|
+
const desired = resolveResponsive(columns, $isMobile);
|
|
52
78
|
return Math.max(1, Math.min(desired, entries.length || 1));
|
|
53
79
|
});
|
|
54
80
|
|
|
@@ -58,22 +84,164 @@
|
|
|
58
84
|
const cellHeight = $derived(
|
|
59
85
|
Math.max(0, Math.floor((height - (rows - 1) * gap) / rows) - TITLE_H),
|
|
60
86
|
);
|
|
87
|
+
|
|
88
|
+
// ── paginated ────────────────────────────────────────────────────────────
|
|
89
|
+
const resolvedPageSize = $derived(Math.max(1, pageSize ?? cols * rows));
|
|
90
|
+
let page = $state(0);
|
|
91
|
+
const totalPages = $derived(Math.max(1, Math.ceil(entries.length / resolvedPageSize)));
|
|
92
|
+
const pageEntries = $derived(
|
|
93
|
+
entries.slice(page * resolvedPageSize, page * resolvedPageSize + resolvedPageSize),
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
$effect(() => {
|
|
97
|
+
if (page > totalPages - 1) page = Math.max(0, totalPages - 1);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
function prevPage(): void {
|
|
101
|
+
page = Math.max(0, page - 1);
|
|
102
|
+
}
|
|
103
|
+
function nextPage(): void {
|
|
104
|
+
page = Math.min(totalPages - 1, page + 1);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ── carousel ─────────────────────────────────────────────────────────────
|
|
108
|
+
const visibleCount = $derived(Math.max(1, Math.min(visible, entries.length || 1)));
|
|
109
|
+
const carouselCellWidth = $derived(
|
|
110
|
+
Math.max(0, Math.floor((width - (visibleCount - 1) * gap) / visibleCount)),
|
|
111
|
+
);
|
|
112
|
+
const carouselCellHeight = $derived(Math.max(0, height - TITLE_H));
|
|
113
|
+
const maxIndex = $derived(Math.max(0, entries.length - visibleCount));
|
|
114
|
+
const stepWidth = $derived(carouselCellWidth + gap);
|
|
115
|
+
|
|
116
|
+
let activeIndex = $state(0);
|
|
117
|
+
let dragOffset = $state(0);
|
|
118
|
+
let dragging = $state(false);
|
|
119
|
+
let dragStartX = 0;
|
|
120
|
+
|
|
121
|
+
const translate = $derived(-activeIndex * stepWidth + dragOffset);
|
|
122
|
+
|
|
123
|
+
$effect(() => {
|
|
124
|
+
if (activeIndex > maxIndex) activeIndex = maxIndex;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Reset browsing position whenever the faceted field or its value set changes.
|
|
128
|
+
$effect(() => {
|
|
129
|
+
void by;
|
|
130
|
+
void values;
|
|
131
|
+
page = 0;
|
|
132
|
+
activeIndex = 0;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
function handleTouchStart(event: TouchEvent): void {
|
|
136
|
+
dragging = true;
|
|
137
|
+
dragStartX = event.touches[0].clientX;
|
|
138
|
+
dragOffset = 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function handleTouchMove(event: TouchEvent): void {
|
|
142
|
+
if (!dragging) return;
|
|
143
|
+
dragOffset = event.touches[0].clientX - dragStartX;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function handleTouchEnd(): void {
|
|
147
|
+
if (!dragging) return;
|
|
148
|
+
dragging = false;
|
|
149
|
+
const stepsMoved = Math.round(-dragOffset / stepWidth);
|
|
150
|
+
activeIndex = Math.max(0, Math.min(maxIndex, activeIndex + stepsMoved));
|
|
151
|
+
dragOffset = 0;
|
|
152
|
+
}
|
|
61
153
|
</script>
|
|
62
154
|
|
|
63
|
-
|
|
64
|
-
class="dct-facet"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
155
|
+
{#snippet indicatorSlot(current: number, total: number)}
|
|
156
|
+
<div class="dct-facet-indicator-slot">
|
|
157
|
+
{#if indicator}
|
|
158
|
+
{@render indicator({ current, total })}
|
|
159
|
+
{:else}
|
|
160
|
+
<FacetIndicator {current} {total} format={formatIndicator} />
|
|
161
|
+
{/if}
|
|
162
|
+
</div>
|
|
163
|
+
{/snippet}
|
|
164
|
+
|
|
165
|
+
{#snippet navButtons(direction: FacetNavDirection, disabled: boolean, onclick: () => void, label: string, glyph: string)}
|
|
166
|
+
<span class="dct-facet-nav-slot">
|
|
167
|
+
{#if navButton}
|
|
168
|
+
{@render navButton({ direction, disabled, onclick })}
|
|
169
|
+
{:else}
|
|
170
|
+
<button
|
|
171
|
+
type="button"
|
|
172
|
+
class="dct-facet-paginated__btn"
|
|
173
|
+
{disabled}
|
|
174
|
+
{onclick}
|
|
175
|
+
aria-label={label}
|
|
176
|
+
>
|
|
177
|
+
{glyph}
|
|
178
|
+
</button>
|
|
179
|
+
{/if}
|
|
180
|
+
</span>
|
|
181
|
+
{/snippet}
|
|
182
|
+
|
|
183
|
+
{#snippet grid(gridEntries: [string, TRow[]][])}
|
|
184
|
+
<div class="dct-facet" style:grid-template-columns="repeat({cols}, 1fr)" style:gap="{gap}px">
|
|
185
|
+
{#each gridEntries as [facetValue, rowsForCell] (facetValue)}
|
|
186
|
+
<div class="dct-facet__cell">
|
|
187
|
+
<div class="dct-facet__title">{facetValue}</div>
|
|
188
|
+
{#if cellWidth > 0 && cellHeight > 0}
|
|
189
|
+
{@render cell({ facetValue, data: rowsForCell, width: cellWidth, height: cellHeight })}
|
|
190
|
+
{/if}
|
|
191
|
+
</div>
|
|
192
|
+
{/each}
|
|
193
|
+
</div>
|
|
194
|
+
{/snippet}
|
|
195
|
+
|
|
196
|
+
{#if resolvedMode === 'paginated'}
|
|
197
|
+
<div class="dct-facet-paginated" style:width="{width}px" style:height="{height}px">
|
|
198
|
+
{@render grid(pageEntries)}
|
|
199
|
+
{#if totalPages > 1}
|
|
200
|
+
<div class="dct-facet-paginated__nav">
|
|
201
|
+
{@render navButtons('prev', page === 0, prevPage, 'Previous page', '‹')}
|
|
202
|
+
{@render navButtons('next', page >= totalPages - 1, nextPage, 'Next page', '›')}
|
|
203
|
+
</div>
|
|
204
|
+
{@render indicatorSlot(page + 1, totalPages)}
|
|
205
|
+
{/if}
|
|
206
|
+
</div>
|
|
207
|
+
{:else if resolvedMode === 'carousel'}
|
|
208
|
+
<div
|
|
209
|
+
class="dct-facet-carousel"
|
|
210
|
+
role="group"
|
|
211
|
+
aria-roledescription="carousel"
|
|
212
|
+
style:width="{width}px"
|
|
213
|
+
style:height="{height}px"
|
|
214
|
+
ontouchstart={handleTouchStart}
|
|
215
|
+
ontouchmove={handleTouchMove}
|
|
216
|
+
ontouchend={handleTouchEnd}
|
|
217
|
+
>
|
|
218
|
+
<div
|
|
219
|
+
class="dct-facet-carousel__track"
|
|
220
|
+
class:dct-facet-carousel__track--dragging={dragging}
|
|
221
|
+
style:gap="{gap}px"
|
|
222
|
+
style:transform="translateX({translate}px)"
|
|
223
|
+
>
|
|
224
|
+
{#each entries as [facetValue, rowsForCell] (facetValue)}
|
|
225
|
+
<div class="dct-facet__cell dct-facet-carousel__cell" style:width="{carouselCellWidth}px">
|
|
226
|
+
<div class="dct-facet__title">{facetValue}</div>
|
|
227
|
+
{#if carouselCellWidth > 0 && carouselCellHeight > 0}
|
|
228
|
+
{@render cell({
|
|
229
|
+
facetValue,
|
|
230
|
+
data: rowsForCell,
|
|
231
|
+
width: carouselCellWidth,
|
|
232
|
+
height: carouselCellHeight,
|
|
233
|
+
})}
|
|
234
|
+
{/if}
|
|
235
|
+
</div>
|
|
236
|
+
{/each}
|
|
74
237
|
</div>
|
|
75
|
-
|
|
76
|
-
|
|
238
|
+
{#if entries.length > 1}
|
|
239
|
+
{@render indicatorSlot(activeIndex + 1, entries.length)}
|
|
240
|
+
{/if}
|
|
241
|
+
</div>
|
|
242
|
+
{:else}
|
|
243
|
+
{@render grid(entries)}
|
|
244
|
+
{/if}
|
|
77
245
|
|
|
78
246
|
<style>
|
|
79
247
|
.dct-facet {
|
|
@@ -94,4 +262,61 @@
|
|
|
94
262
|
text-align: center;
|
|
95
263
|
opacity: 0.9;
|
|
96
264
|
}
|
|
265
|
+
|
|
266
|
+
.dct-facet-paginated {
|
|
267
|
+
position: relative;
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: column;
|
|
270
|
+
}
|
|
271
|
+
.dct-facet-paginated__nav {
|
|
272
|
+
position: absolute;
|
|
273
|
+
top: 50%;
|
|
274
|
+
left: 0;
|
|
275
|
+
right: 0;
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: space-between;
|
|
278
|
+
transform: translateY(-50%);
|
|
279
|
+
pointer-events: none;
|
|
280
|
+
}
|
|
281
|
+
.dct-facet-nav-slot {
|
|
282
|
+
pointer-events: auto;
|
|
283
|
+
}
|
|
284
|
+
.dct-facet-paginated__btn {
|
|
285
|
+
border: none;
|
|
286
|
+
border-radius: 999px;
|
|
287
|
+
width: var(--dct-facet-nav-btn-size, 2rem);
|
|
288
|
+
height: var(--dct-facet-nav-btn-size, 2rem);
|
|
289
|
+
font-size: var(--dct-facet-nav-font-size, 1.1rem);
|
|
290
|
+
line-height: 1;
|
|
291
|
+
background: var(--dct-facet-nav-bg, #111827);
|
|
292
|
+
color: var(--dct-facet-nav-color, #fff);
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
}
|
|
295
|
+
.dct-facet-paginated__btn:disabled {
|
|
296
|
+
opacity: var(--dct-facet-nav-disabled-opacity, 0.3);
|
|
297
|
+
cursor: default;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.dct-facet-indicator-slot {
|
|
301
|
+
position: absolute;
|
|
302
|
+
right: 0.5rem;
|
|
303
|
+
bottom: 0.5rem;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.dct-facet-carousel {
|
|
307
|
+
position: relative;
|
|
308
|
+
overflow: hidden;
|
|
309
|
+
touch-action: pan-y;
|
|
310
|
+
}
|
|
311
|
+
.dct-facet-carousel__track {
|
|
312
|
+
display: flex;
|
|
313
|
+
height: 100%;
|
|
314
|
+
transition: transform 0.25s ease;
|
|
315
|
+
}
|
|
316
|
+
.dct-facet-carousel__track--dragging {
|
|
317
|
+
transition: none;
|
|
318
|
+
}
|
|
319
|
+
.dct-facet-carousel__cell {
|
|
320
|
+
flex: 0 0 auto;
|
|
321
|
+
}
|
|
97
322
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FacetColumns, FacetCellSnippet } from '../../types/
|
|
1
|
+
import type { FacetColumns, FacetMode, Responsive, FacetCellSnippet, FacetIndicatorSnippet, FacetNavSnippet } from '../../types/layout/facet';
|
|
2
2
|
import type { Accessor } from '../../types/plots/data/common';
|
|
3
3
|
declare function $$render<TRow extends Record<string, unknown>>(): {
|
|
4
4
|
props: {
|
|
@@ -7,6 +7,12 @@ declare function $$render<TRow extends Record<string, unknown>>(): {
|
|
|
7
7
|
columns?: FacetColumns;
|
|
8
8
|
values?: string[];
|
|
9
9
|
gap?: number;
|
|
10
|
+
mode?: Responsive<FacetMode>;
|
|
11
|
+
visible?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
formatIndicator?: (current: number, total: number) => string;
|
|
14
|
+
indicator?: FacetIndicatorSnippet;
|
|
15
|
+
navButton?: FacetNavSnippet;
|
|
10
16
|
width: number;
|
|
11
17
|
height: number;
|
|
12
18
|
cell: FacetCellSnippet<TRow>;
|