@rokkit/chart 1.3.15 → 1.4.1

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.
Files changed (47) hide show
  1. package/dist/Plot.svelte +25 -9
  2. package/dist/PlotState.svelte.d.ts +1 -0
  3. package/dist/PlotState.svelte.js +19 -8
  4. package/dist/Spark.svelte +165 -0
  5. package/dist/Spark.svelte.d.ts +31 -0
  6. package/dist/SparkState.svelte.d.ts +138 -0
  7. package/dist/SparkState.svelte.js +331 -0
  8. package/dist/Sparkline.svelte +62 -237
  9. package/dist/Sparkline.svelte.d.ts +2 -0
  10. package/dist/charts/RadarChart.svelte +106 -0
  11. package/dist/charts/RadarChart.svelte.d.ts +43 -0
  12. package/dist/geoms/Area.svelte +24 -9
  13. package/dist/geoms/Area.svelte.d.ts +2 -0
  14. package/dist/geoms/Bar.svelte +9 -16
  15. package/dist/geoms/Highlight.svelte +61 -40
  16. package/dist/geoms/Line.svelte +10 -9
  17. package/dist/geoms/Point.svelte +9 -15
  18. package/dist/geoms/Radar.svelte +352 -0
  19. package/dist/geoms/Radar.svelte.d.ts +42 -0
  20. package/dist/geoms/Trend.svelte +46 -23
  21. package/dist/geoms/lib/aesthetics.d.ts +14 -0
  22. package/dist/geoms/lib/aesthetics.js +21 -0
  23. package/dist/geoms/lib/areas.d.ts +9 -2
  24. package/dist/geoms/lib/areas.js +53 -8
  25. package/dist/geoms/lib/marks/area.d.ts +3 -0
  26. package/dist/geoms/lib/marks/area.js +11 -2
  27. package/dist/geoms/lib/marks/radar.d.ts +68 -0
  28. package/dist/geoms/lib/marks/radar.js +153 -0
  29. package/dist/index.d.ts +6 -0
  30. package/dist/index.js +7 -1
  31. package/dist/lib/brewing/marks/boxes.js +19 -30
  32. package/dist/lib/brewing/polar.d.ts +444 -0
  33. package/dist/lib/brewing/polar.js +645 -0
  34. package/dist/lib/highlight.js +84 -33
  35. package/dist/lib/plot/scales.js +8 -5
  36. package/dist/lib/preset.d.ts +1 -0
  37. package/dist/lib/preset.js +2 -1
  38. package/dist/lib/select.d.ts +25 -11
  39. package/dist/lib/select.js +14 -7
  40. package/dist/lib/trend.js +55 -39
  41. package/package.json +1 -1
  42. package/dist/examples/BarChartExample.svelte +0 -78
  43. package/dist/examples/BarChartExample.svelte.d.ts +0 -18
  44. package/dist/lib/brewing/types.d.ts +0 -162
  45. package/dist/lib/brewing/types.js +0 -73
  46. package/dist/lib/xscale.d.ts +0 -11
  47. package/dist/lib/xscale.js +0 -31
@@ -1,73 +0,0 @@
1
- /**
2
- * @typedef {Object} ChartMargin
3
- * @property {number} top - Top margin
4
- * @property {number} right - Right margin
5
- * @property {number} bottom - Bottom margin
6
- * @property {number} left - Left margin
7
- */
8
-
9
- /**
10
- * @typedef {Object} ChartDimensions
11
- * @property {number} width - Total chart width
12
- * @property {number} height - Total chart height
13
- * @property {ChartMargin} margin - Chart margins
14
- * @property {number} innerWidth - Chart width without margins
15
- * @property {number} innerHeight - Chart height without margins
16
- */
17
-
18
- /**
19
- * @typedef {Object} ChartScales
20
- * @property {Function} x - X-axis scale function
21
- * @property {Function} y - Y-axis scale function
22
- * @property {Function} color - Color scale function
23
- */
24
-
25
- /**
26
- * @typedef {Object} ScaleFields
27
- * @property {string} x - X-axis field
28
- * @property {string} y - Y-axis field
29
- * @property {string} color - Color field
30
- */
31
-
32
- /**
33
- * @typedef {Object} TickData
34
- * @property {*} value - Tick value
35
- * @property {number} position - Tick position in pixels
36
- * @property {string} formattedValue - Formatted tick label
37
- */
38
-
39
- /**
40
- * @typedef {Object} AxisData
41
- * @property {TickData[]} ticks - Tick data
42
- * @property {string} label - Axis label
43
- * @property {string} transform - SVG transform attribute value
44
- * @property {string} labelTransform - SVG transform for the label
45
- */
46
-
47
- /**
48
- * @typedef {Object} BarData
49
- * @property {Object} data - Original data point
50
- * @property {number} x - X position
51
- * @property {number} y - Y position
52
- * @property {number} width - Width of the bar
53
- * @property {number} height - Height of the bar
54
- * @property {string} color - Color of the bar
55
- */
56
-
57
- /**
58
- * @typedef {Object} LegendItem
59
- * @property {*} value - Legend item value
60
- * @property {string} color - Item color
61
- * @property {number} y - Y position
62
- * @property {string} shape - Shape type ('rect' or 'circle')
63
- * @property {number} markerSize - Size of the marker
64
- */
65
-
66
- /**
67
- * @typedef {Object} LegendData
68
- * @property {LegendItem[]} items - Legend items
69
- * @property {string} title - Legend title
70
- * @property {string} transform - SVG transform attribute value
71
- */
72
-
73
- export {}
@@ -1,11 +0,0 @@
1
- /**
2
- * Builds an appropriate D3 x-axis scale based on value types.
3
- * Returns scaleTime for Date values, scaleLinear for numeric values,
4
- * or scaleBand for categorical values.
5
- *
6
- * @param {Array} xValues
7
- * @param {Object} dimensions
8
- * @param {number} padding
9
- * @returns {import('d3-scale').ScaleContinuousNumeric|import('d3-scale').ScaleBand}
10
- */
11
- export function buildXScale(xValues: any[], dimensions: Object, padding: number): import("d3-scale").ScaleContinuousNumeric<any, any, never> | import("d3-scale").ScaleBand<any>;
@@ -1,31 +0,0 @@
1
- import { scaleBand, scaleLinear, scaleTime } from 'd3-scale'
2
- import { min, max } from 'd3-array'
3
-
4
- /**
5
- * Builds an appropriate D3 x-axis scale based on value types.
6
- * Returns scaleTime for Date values, scaleLinear for numeric values,
7
- * or scaleBand for categorical values.
8
- *
9
- * @param {Array} xValues
10
- * @param {Object} dimensions
11
- * @param {number} padding
12
- * @returns {import('d3-scale').ScaleContinuousNumeric|import('d3-scale').ScaleBand}
13
- */
14
- export function buildXScale(xValues, dimensions, padding) {
15
- const xIsDate = xValues.some((v) => v instanceof Date)
16
- const xIsNumeric = !xIsDate && xValues.every((v) => !isNaN(parseFloat(v)))
17
-
18
- if (xIsDate) {
19
- return scaleTime()
20
- .domain([min(xValues), max(xValues)])
21
- .range([0, dimensions.innerWidth])
22
- .nice()
23
- }
24
- if (xIsNumeric) {
25
- return scaleLinear()
26
- .domain([min([0, ...xValues]), max(xValues)])
27
- .range([0, dimensions.innerWidth])
28
- .nice()
29
- }
30
- return scaleBand().domain(xValues).range([0, dimensions.innerWidth]).padding(padding)
31
- }