@cfasim-ui/charts 0.3.12 → 0.3.14

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.
@@ -89,10 +89,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
89
89
  legend: boolean;
90
90
  menu: boolean | string;
91
91
  tooltipClamp: "none" | "chart" | "window";
92
+ strokeWidth: number;
92
93
  geoType: GeoType;
93
94
  noDataColor: string;
94
95
  strokeColor: string;
95
- strokeWidth: number;
96
96
  zoom: boolean;
97
97
  pan: boolean;
98
98
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
@@ -1,5 +1,24 @@
1
+ /**
2
+ * Numeric input accepted by the chart. `number[]` and any standard numeric
3
+ * typed array are supported, so the output of
4
+ * `ModelOutput.column('x')` (e.g. a `Float64Array`) can be passed directly
5
+ * without copying into a plain array.
6
+ */
7
+ export type LineChartData = readonly number[] | Float64Array | Float32Array | Int32Array | Uint32Array | Int16Array | Uint16Array | Int8Array | Uint8Array | Uint8ClampedArray;
1
8
  export interface Series {
2
- data: number[];
9
+ /**
10
+ * Y-values. One of `y` or `data` must be supplied; `y` wins if both
11
+ * are set.
12
+ */
13
+ y?: LineChartData;
14
+ /** Y-values (alternative name for `y`). */
15
+ data?: LineChartData;
16
+ /**
17
+ * Optional x-values, parallel to `y`/`data`. When set, the chart
18
+ * plots points at the given x positions (irregular spacing supported).
19
+ * When omitted, points are plotted at indices 0, 1, 2, ...
20
+ */
21
+ x?: LineChartData;
3
22
  color?: string;
4
23
  dashed?: boolean;
5
24
  strokeWidth?: number;
@@ -15,8 +34,10 @@ export interface Series {
15
34
  legend?: string;
16
35
  }
17
36
  export interface Area {
18
- upper: number[];
19
- lower: number[];
37
+ upper: LineChartData;
38
+ lower: LineChartData;
39
+ /** Optional x-values parallel to `upper`/`lower`. See `Series.x`. */
40
+ x?: LineChartData;
20
41
  color?: string;
21
42
  opacity?: number;
22
43
  }
@@ -43,7 +64,16 @@ export interface AreaSection {
43
64
  legend?: "inline" | "below" | false;
44
65
  }
45
66
  type __VLS_Props = {
46
- data?: number[];
67
+ /** Y-values. Equivalent to `data`. If both are set, `y` wins. */
68
+ y?: LineChartData;
69
+ /** Y-values (alternative name for `y`). */
70
+ data?: LineChartData;
71
+ /**
72
+ * Optional x-values paired with `y`/`data`. When provided, points
73
+ * are plotted at the given x positions instead of at their indices.
74
+ * Ignored when `series` is used — set `x` on each `Series` instead.
75
+ */
76
+ x?: LineChartData;
47
77
  series?: Series[];
48
78
  areas?: Area[];
49
79
  areaSections?: AreaSection[];
@@ -54,6 +84,11 @@ type __VLS_Props = {
54
84
  xLabel?: string;
55
85
  yLabel?: string;
56
86
  yMin?: number;
87
+ /**
88
+ * Offset applied to index-based x values (e.g. `xMin: 10` starts the
89
+ * x axis at 10 instead of 0). Ignored when any series or area has
90
+ * explicit `x` values.
91
+ */
57
92
  xMin?: number;
58
93
  /**
59
94
  * Tick placement on the x-axis. Number = interval in data units
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .chart-menu-trigger-area[data-v-fe2f6904]{z-index:1;position:absolute;top:0;right:0}.chart-menu-button[data-v-fe2f6904]{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);width:28px;height:28px;color:var(--color-text-secondary);cursor:pointer;opacity:0;border-radius:.25em;justify-content:center;align-items:center;transition:opacity .15s;display:flex}.chart-menu-button[data-state=open][data-v-fe2f6904]{opacity:1}.chart-menu-button[data-v-fe2f6904]:hover{background:var(--color-bg-1,#0000000d);color:var(--color-text)}.chart-menu-content{z-index:100;background:var(--color-bg-0);border:1px solid var(--color-border);border-radius:.25em;min-width:140px;padding:.25em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.chart-menu-item{font-size:var(--font-size-sm);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;border-radius:.25em;outline:none;align-items:center;padding:.375em .5em;display:flex}.chart-menu-item[data-highlighted]{background:var(--color-primary);color:#fff}.line-chart-wrapper[data-v-459cca76]{width:100%;position:relative}.line-chart-wrapper[data-v-459cca76]:hover .chart-menu-button{opacity:1}.line-chart-tooltip-label[data-v-459cca76]{margin-bottom:.25em;font-weight:600}.line-chart-tooltip-row[data-v-459cca76]{align-items:center;gap:.375em;display:flex}.line-chart-download-link[data-v-459cca76]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}.line-chart-tooltip-swatch[data-v-459cca76]{border-radius:50%;flex-shrink:0;width:.625em;height:.625em;display:inline-block}.choropleth-wrapper[data-v-25a20d5b]{width:100%;position:relative}.choropleth-wrapper.pannable svg[data-v-25a20d5b]{cursor:grab}.choropleth-wrapper.pannable svg[data-v-25a20d5b]:active{cursor:grabbing}.choropleth-wrapper[data-v-25a20d5b]:hover .chart-menu-button{opacity:1}.state-path[data-v-25a20d5b]{cursor:pointer}.chart-tooltip-anchor[data-v-44377f70]{pointer-events:none;width:1px;height:1px;position:absolute}.chart-tooltip-content{z-index:100;background:var(--color-bg-0,#fff);border:1px solid var(--color-border,#e5e7eb);font-size:var(--font-size-sm,.875rem);pointer-events:none;border-radius:.375em;padding:.5em .75em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.TableOuter[data-v-505e2187]{display:inline-block;position:relative}.TableOuter.has-menu[data-v-505e2187]{margin-top:32px}.TableOuter[data-v-505e2187] .chart-menu-trigger-area{top:-32px;right:0}.TableOuter[data-v-505e2187]:hover .chart-menu-button{opacity:1}.TableWrapper[data-v-505e2187]{font-size:var(--font-size-sm);overflow-x:auto}.Table[data-v-505e2187]{border-collapse:collapse;font-variant-numeric:tabular-nums;border:1px solid var(--color-border);margin:0;display:table}.Table tr[data-v-505e2187],.Table th[data-v-505e2187],.Table td[data-v-505e2187]{background:0 0;border:none}.Table th[data-v-505e2187],.Table td[data-v-505e2187]{white-space:nowrap;padding:.75em 1.25em}.Table th[data-v-505e2187]{border-bottom:1px solid var(--color-border-header);font-weight:600;position:sticky;top:0}.Table tbody td[data-v-505e2187]{border-bottom:1px solid var(--color-border)}.Table tbody tr:last-child td[data-v-505e2187]{border-bottom:none}.data-table-download-link[data-v-505e2187]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}
1
+ .chart-menu-trigger-area[data-v-fe2f6904]{z-index:1;position:absolute;top:0;right:0}.chart-menu-button[data-v-fe2f6904]{border:1px solid var(--color-border);background:var(--color-bg-0,#fff);width:28px;height:28px;color:var(--color-text-secondary);cursor:pointer;opacity:0;border-radius:.25em;justify-content:center;align-items:center;transition:opacity .15s;display:flex}.chart-menu-button[data-state=open][data-v-fe2f6904]{opacity:1}.chart-menu-button[data-v-fe2f6904]:hover{background:var(--color-bg-1,#0000000d);color:var(--color-text)}.chart-menu-content{z-index:100;background:var(--color-bg-0);border:1px solid var(--color-border);border-radius:.25em;min-width:140px;padding:.25em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.chart-menu-item{font-size:var(--font-size-sm);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;border-radius:.25em;outline:none;align-items:center;padding:.375em .5em;display:flex}.chart-menu-item[data-highlighted]{background:var(--color-primary);color:#fff}.line-chart-wrapper[data-v-dc8afa83]{width:100%;position:relative}.line-chart-wrapper[data-v-dc8afa83]:hover .chart-menu-button{opacity:1}.line-chart-tooltip-label[data-v-dc8afa83]{margin-bottom:.25em;font-weight:600}.line-chart-tooltip-row[data-v-dc8afa83]{align-items:center;gap:.375em;display:flex}.line-chart-download-link[data-v-dc8afa83]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}.line-chart-tooltip-swatch[data-v-dc8afa83]{border-radius:50%;flex-shrink:0;width:.625em;height:.625em;display:inline-block}.choropleth-wrapper[data-v-25a20d5b]{width:100%;position:relative}.choropleth-wrapper.pannable svg[data-v-25a20d5b]{cursor:grab}.choropleth-wrapper.pannable svg[data-v-25a20d5b]:active{cursor:grabbing}.choropleth-wrapper[data-v-25a20d5b]:hover .chart-menu-button{opacity:1}.state-path[data-v-25a20d5b]{cursor:pointer}.chart-tooltip-anchor[data-v-44377f70]{pointer-events:none;width:1px;height:1px;position:absolute}.chart-tooltip-content{z-index:100;background:var(--color-bg-0,#fff);border:1px solid var(--color-border,#e5e7eb);font-size:var(--font-size-sm,.875rem);pointer-events:none;border-radius:.375em;padding:.5em .75em;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.TableOuter[data-v-505e2187]{display:inline-block;position:relative}.TableOuter.has-menu[data-v-505e2187]{margin-top:32px}.TableOuter[data-v-505e2187] .chart-menu-trigger-area{top:-32px;right:0}.TableOuter[data-v-505e2187]:hover .chart-menu-button{opacity:1}.TableWrapper[data-v-505e2187]{font-size:var(--font-size-sm);overflow-x:auto}.Table[data-v-505e2187]{border-collapse:collapse;font-variant-numeric:tabular-nums;border:1px solid var(--color-border);margin:0;display:table}.Table tr[data-v-505e2187],.Table th[data-v-505e2187],.Table td[data-v-505e2187]{background:0 0;border:none}.Table th[data-v-505e2187],.Table td[data-v-505e2187]{white-space:nowrap;padding:.75em 1.25em}.Table th[data-v-505e2187]{border-bottom:1px solid var(--color-border-header);font-weight:600;position:sticky;top:0}.Table tbody td[data-v-505e2187]{border-bottom:1px solid var(--color-border)}.Table tbody tr:last-child td[data-v-505e2187]{border-bottom:none}.data-table-download-link[data-v-505e2187]{text-align:right;font-size:var(--font-size-sm);margin-top:.25em;display:block}
2
2
  /*$vite$:1*/
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as LineChart, type Series, type Area, type AreaSection, } from './LineChart/LineChart';
1
+ export { default as LineChart, type LineChartData, type Series, type Area, type AreaSection, } from './LineChart/LineChart';
2
2
  export { default as ChoroplethMap, type GeoType, type StateData, type ChoroplethColorScale, type ThresholdStop, type CategoricalStop, } from './ChoroplethMap/ChoroplethMap';
3
3
  export { default as ChartTooltip } from './ChartTooltip/ChartTooltip';
4
4
  export { default as DataTable, type TableData, type TableRecord, type ColumnAlign, type ColumnConfig, type ColumnWidth, } from './DataTable/DataTable';