@cfasim-ui/charts 0.1.8 → 0.1.10
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/ChartMenu/ChartMenu.d.ts +9 -0
- package/dist/ChartMenu/download.d.ts +4 -0
- package/dist/ChoroplethMap/ChoroplethMap.d.ts +83 -0
- package/dist/ChoroplethMap/ChoroplethMap.test.d.ts +1 -0
- package/dist/ChoroplethMap/hsaMapping.d.ts +4 -0
- package/dist/DataTable/DataTable.d.ts +21 -0
- package/dist/DataTable/DataTable.test.d.ts +1 -0
- package/dist/LineChart/LineChart.d.ts +39 -0
- package/dist/LineChart/LineChart.spec.d.ts +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4963 -0
- package/package.json +18 -4
- package/src/ChartMenu/ChartMenu.vue +0 -140
- package/src/ChartMenu/download.ts +0 -44
- package/src/ChoroplethMap/ChoroplethMap.md +0 -330
- package/src/ChoroplethMap/ChoroplethMap.test.ts +0 -468
- package/src/ChoroplethMap/ChoroplethMap.vue +0 -629
- package/src/ChoroplethMap/hsaMapping.ts +0 -4116
- package/src/DataTable/DataTable.md +0 -101
- package/src/DataTable/DataTable.test.ts +0 -177
- package/src/DataTable/DataTable.vue +0 -217
- package/src/LineChart/LineChart.md +0 -182
- package/src/LineChart/LineChart.spec.ts +0 -11
- package/src/LineChart/LineChart.vue +0 -465
- package/src/index.ts +0 -21
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ChartMenuItem {
|
|
2
|
+
label: string;
|
|
3
|
+
action: () => void;
|
|
4
|
+
}
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
items: ChartMenuItem[];
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function downloadBlob(blob: Blob, name: string): void;
|
|
2
|
+
export declare function saveSvg(svg: SVGSVGElement, filename: string): void;
|
|
3
|
+
export declare function savePng(svg: SVGSVGElement, filename: string): void;
|
|
4
|
+
export declare function downloadCsv(csv: string, filename: string): void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type GeoType = "states" | "counties" | "hsas";
|
|
2
|
+
export interface StateData {
|
|
3
|
+
/** FIPS code (e.g. "06" for California, "04015" for a county) or name */
|
|
4
|
+
id: string;
|
|
5
|
+
value: number | string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChoroplethColorScale {
|
|
8
|
+
/** Minimum color (CSS color string). Default: "#e5f0fa" */
|
|
9
|
+
min?: string;
|
|
10
|
+
/** Maximum color (CSS color string). Default: "#08519c" */
|
|
11
|
+
max?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ThresholdStop {
|
|
14
|
+
/** Lower bound (inclusive). Values at or above this threshold get this color. */
|
|
15
|
+
min: number;
|
|
16
|
+
color: string;
|
|
17
|
+
/** Optional label for the legend (defaults to the min value) */
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CategoricalStop {
|
|
21
|
+
/** The categorical value to match */
|
|
22
|
+
value: string;
|
|
23
|
+
/** CSS color string */
|
|
24
|
+
color: string;
|
|
25
|
+
}
|
|
26
|
+
type __VLS_Props = {
|
|
27
|
+
data?: StateData[];
|
|
28
|
+
/** Geographic type: "states" (default), "counties", or "hsas" (Health Service Areas) */
|
|
29
|
+
geoType?: GeoType;
|
|
30
|
+
width?: number;
|
|
31
|
+
height?: number;
|
|
32
|
+
colorScale?: ChoroplethColorScale | ThresholdStop[] | CategoricalStop[];
|
|
33
|
+
title?: string;
|
|
34
|
+
noDataColor?: string;
|
|
35
|
+
strokeColor?: string;
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
menu?: boolean | string;
|
|
38
|
+
/** Show legend. Default: true */
|
|
39
|
+
legend?: boolean;
|
|
40
|
+
/** Title displayed next to the legend */
|
|
41
|
+
legendTitle?: string;
|
|
42
|
+
/** Enable mouse-wheel zooming. Default: false */
|
|
43
|
+
zoom?: boolean;
|
|
44
|
+
/** Enable click-and-drag panning. Default: false */
|
|
45
|
+
pan?: boolean;
|
|
46
|
+
};
|
|
47
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
48
|
+
stateClick: (state: {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
value?: number | string;
|
|
52
|
+
}) => any;
|
|
53
|
+
stateHover: (state: {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
value?: number | string;
|
|
57
|
+
} | null) => any;
|
|
58
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
59
|
+
onStateClick?: ((state: {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
value?: number | string;
|
|
63
|
+
}) => any) | undefined;
|
|
64
|
+
onStateHover?: ((state: {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
value?: number | string;
|
|
68
|
+
} | null) => any) | undefined;
|
|
69
|
+
}>, {
|
|
70
|
+
legend: boolean;
|
|
71
|
+
menu: boolean | string;
|
|
72
|
+
geoType: GeoType;
|
|
73
|
+
noDataColor: string;
|
|
74
|
+
strokeColor: string;
|
|
75
|
+
strokeWidth: number;
|
|
76
|
+
zoom: boolean;
|
|
77
|
+
pan: boolean;
|
|
78
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
79
|
+
containerRef: HTMLDivElement;
|
|
80
|
+
svgRef: SVGSVGElement;
|
|
81
|
+
mapGroupRef: SVGGElement;
|
|
82
|
+
}, HTMLDivElement>;
|
|
83
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ModelOutput } from '@cfasim-ui/shared';
|
|
2
|
+
export type TableRecord = Record<string, ArrayLike<number | string | boolean>>;
|
|
3
|
+
export type TableData = TableRecord | ModelOutput;
|
|
4
|
+
export type ColumnWidth = "small" | "medium" | "large";
|
|
5
|
+
export type ColumnAlign = "left" | "center" | "right";
|
|
6
|
+
export interface ColumnConfig {
|
|
7
|
+
label?: string;
|
|
8
|
+
width?: ColumnWidth | number;
|
|
9
|
+
align?: ColumnAlign;
|
|
10
|
+
cellClass?: string;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
data: TableData;
|
|
14
|
+
maxRows?: number;
|
|
15
|
+
columnConfig?: Record<string, ColumnConfig>;
|
|
16
|
+
menu?: boolean | string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
menu: boolean | string;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface Series {
|
|
2
|
+
data: number[];
|
|
3
|
+
color?: string;
|
|
4
|
+
dashed?: boolean;
|
|
5
|
+
strokeWidth?: number;
|
|
6
|
+
opacity?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Area {
|
|
9
|
+
upper: number[];
|
|
10
|
+
lower: number[];
|
|
11
|
+
color?: string;
|
|
12
|
+
opacity?: number;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
data?: number[];
|
|
16
|
+
series?: Series[];
|
|
17
|
+
areas?: Area[];
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
lineOpacity?: number;
|
|
21
|
+
title?: string;
|
|
22
|
+
xLabel?: string;
|
|
23
|
+
yLabel?: string;
|
|
24
|
+
yMin?: number;
|
|
25
|
+
xMin?: number;
|
|
26
|
+
xLabels?: string[];
|
|
27
|
+
debounce?: number;
|
|
28
|
+
menu?: boolean | string;
|
|
29
|
+
xGrid?: boolean;
|
|
30
|
+
yGrid?: boolean;
|
|
31
|
+
};
|
|
32
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
33
|
+
menu: boolean | string;
|
|
34
|
+
lineOpacity: number;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
36
|
+
containerRef: HTMLDivElement;
|
|
37
|
+
svgRef: SVGSVGElement;
|
|
38
|
+
}, HTMLDivElement>;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.chart-menu-trigger-area[data-v-adef2467]{z-index:1;position:absolute;top:0;right:0}.chart-menu-button[data-v-adef2467]{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-adef2467]{opacity:1}.chart-menu-button[data-v-adef2467]: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-128f8091]{width:100%;position:relative}.line-chart-wrapper[data-v-128f8091]:hover .chart-menu-button{opacity:1}.choropleth-wrapper[data-v-64b95aef]{width:100%;position:relative}.choropleth-wrapper.pannable svg[data-v-64b95aef]{cursor:grab}.choropleth-wrapper.pannable svg[data-v-64b95aef]:active{cursor:grabbing}.choropleth-wrapper[data-v-64b95aef]:hover .chart-menu-button{opacity:1}.state-path[data-v-64b95aef]{cursor:pointer;transition:fill-opacity .15s}.state-path[data-v-64b95aef]:hover{fill-opacity:.8}.TableOuter[data-v-dbfb7c84]{display:inline-block;position:relative}.TableOuter.has-menu[data-v-dbfb7c84]{padding-top:32px}.TableOuter[data-v-dbfb7c84]:hover .chart-menu-button{opacity:1}.TableWrapper[data-v-dbfb7c84]{font-size:var(--font-size-sm);overflow-x:auto}.Table[data-v-dbfb7c84]{border-collapse:collapse;font-variant-numeric:tabular-nums;border:1px solid var(--color-border)}.Table tr[data-v-dbfb7c84],.Table th[data-v-dbfb7c84],.Table td[data-v-dbfb7c84]{background:0 0;border:none}.Table th[data-v-dbfb7c84],.Table td[data-v-dbfb7c84]{white-space:nowrap;padding:.75em 1.25em}.Table th[data-v-dbfb7c84]{border-bottom:1px solid var(--color-border-header);font-weight:600;position:sticky;top:0}.Table tbody td[data-v-dbfb7c84]{border-bottom:1px solid var(--color-border)}.Table tbody tr:last-child td[data-v-dbfb7c84]{border-bottom:none}
|
|
2
|
+
/*$vite$:1*/
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as LineChart, type Series, type Area, } from './LineChart/LineChart';
|
|
2
|
+
export { default as ChoroplethMap, type GeoType, type StateData, type ChoroplethColorScale, type ThresholdStop, type CategoricalStop, } from './ChoroplethMap/ChoroplethMap';
|
|
3
|
+
export { default as DataTable, type TableData, type TableRecord, type ColumnAlign, type ColumnConfig, type ColumnWidth, } from './DataTable/DataTable';
|