@milaboratories/miplots4 1.0.130 → 1.0.132
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/heatmap/components/Annotations/Annotation.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.js +34 -33
- package/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/heatmap/components/Chart.d.ts.map +1 -1
- package/dist/heatmap/components/Chart.js +90 -85
- package/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/heatmap/components/types.d.ts +2 -1
- package/dist/heatmap/components/types.d.ts.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +6 -3
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.js +59 -60
- package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/scatterplot/components/ChartTooltip.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartTooltip.js +42 -40
- package/dist/scatterplot/components/ChartTooltip.js.map +1 -1
- package/dist/scatterplot/dots.d.ts +2 -1
- package/dist/scatterplot/dots.d.ts.map +1 -1
- package/dist/scatterplot/dots.js +26 -27
- package/dist/scatterplot/dots.js.map +1 -1
- package/dist/scatterplot/getLayersData.d.ts.map +1 -1
- package/dist/scatterplot/getLayersData.js +15 -12
- package/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/scatterplot/index.d.ts.map +1 -1
- package/dist/scatterplot/index.js +66 -72
- package/dist/scatterplot/index.js.map +1 -1
- package/dist/scatterplot/utils/createLegendInfo.d.ts +3 -3
- package/dist/scatterplot/utils/createLegendInfo.d.ts.map +1 -1
- package/dist/scatterplot/utils/createLegendInfo.js +44 -39
- package/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/scatterplot/utils/formatColumnValue.d.ts +5 -0
- package/dist/scatterplot/utils/formatColumnValue.d.ts.map +1 -0
- package/dist/scatterplot/utils/formatColumnValue.js +11 -0
- package/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.d.ts +8 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.d.ts.map +1 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
- package/dist/scatterplot-umap/SettingsImpl.d.ts +6 -3
- package/dist/scatterplot-umap/SettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot-umap/SettingsImpl.js +54 -55
- package/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js +88 -86
- package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/scatterplot-umap/index.d.ts.map +1 -1
- package/dist/scatterplot-umap/index.js +98 -92
- package/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/types/bubble.d.ts +44 -12
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/common.d.ts +18 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/dendro.d.ts +111 -8
- package/dist/types/dendro.d.ts.map +1 -1
- package/dist/types/discrete.d.ts +105 -28
- package/dist/types/discrete.d.ts.map +1 -1
- package/dist/types/heatmap.d.ts +187 -28
- package/dist/types/heatmap.d.ts.map +1 -1
- package/dist/types/histogram.d.ts +42 -20
- package/dist/types/histogram.d.ts.map +1 -1
- package/dist/types/scatterplot-umap.d.ts +259 -71
- package/dist/types/scatterplot-umap.d.ts.map +1 -1
- package/dist/types/scatterplot-umap.js +22 -16
- package/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/types/scatterplot.d.ts +273 -71
- package/dist/types/scatterplot.d.ts.map +1 -1
- package/dist/types/scatterplot.js +16 -10
- package/dist/types/scatterplot.js.map +1 -1
- package/dist/utils/arraysAreDifferent.d.ts +2 -0
- package/dist/utils/arraysAreDifferent.d.ts.map +1 -0
- package/dist/utils/arraysAreDifferent.js +7 -0
- package/dist/utils/arraysAreDifferent.js.map +1 -0
- package/dist/utils/getChartEdgeSides.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLegendInfo.js","sources":["../../../src/scatterplot/utils/createLegendInfo.ts"],"sourcesContent":["import { MAX_SHOWN_UNIQUE_VALUES_IN_LABELS } from '../../constants';\nimport type { DataFrame } from '../../DataFrame';\nimport type {\n AesItem,\n Category,\n ColumnName,\n ContinuousAesFromColumn,\n InheritAesScatterplot,\n ScatterplotLayer,\n ScatterplotLegendInfo\n} from '../../types';\nimport type { ScatterplotSettingsImpl } from '../ScatterplotSettingsImpl';\n\nconst categoryIndexer = (() => {\n const map = new Map<string, Map<Category, number>>();\n const clear = () => map.clear();\n const getIndex = (columnName: ColumnName, category: Category): number => {\n let categoryMap = map.get(columnName.value);\n if (categoryMap === undefined) {\n categoryMap = new Map();\n map.set(columnName.value, categoryMap);\n }\n let index = categoryMap.get(category);\n if (index === undefined) {\n index = categoryMap.size;\n categoryMap.set(category, index);\n }\n return index;\n };\n\n return {\n clear,\n getIndex,\n };\n})();\n\nexport function addPalettesToAesMapping(\n columnName: ColumnName,\n usedAesFromPalettes: Partial<Record<keyof AesItem, string[]>>,\n inheritedAes?:
|
|
1
|
+
{"version":3,"file":"createLegendInfo.js","sources":["../../../src/scatterplot/utils/createLegendInfo.ts"],"sourcesContent":["import { MAX_SHOWN_UNIQUE_VALUES_IN_LABELS } from '../../constants';\nimport type { DataFrame } from '../../DataFrame';\nimport type {AesRecord} from '../../types';\nimport type {\n AesItem,\n Category,\n ColumnName,\n ContinuousAesFromColumn,\n InheritAesScatterplot,\n ScatterplotLayer,\n ScatterplotLegendInfo\n} from '../../types';\nimport type { ScatterplotSettingsImpl } from '../ScatterplotSettingsImpl';\n\nconst categoryIndexer = (() => {\n const map = new Map<string, Map<Category, number>>();\n const clear = () => map.clear();\n const getIndex = (columnName: ColumnName, category: Category): number => {\n let categoryMap = map.get(columnName.value);\n if (categoryMap === undefined) {\n categoryMap = new Map();\n map.set(columnName.value, categoryMap);\n }\n let index = categoryMap.get(category);\n if (index === undefined) {\n index = categoryMap.size;\n categoryMap.set(category, index);\n }\n return index;\n };\n\n return {\n clear,\n getIndex,\n };\n})();\n\nexport function addPalettesToAesMapping(\n columnName: ColumnName,\n usedAesFromPalettes: Partial<Record<keyof AesItem, string[]>>,\n inheritedAes?: AesRecord\n) {\n categoryIndexer.clear();\n const hasInheritedAes = inheritedAes && Object.keys(inheritedAes).length > 0;\n const dotFill = usedAesFromPalettes['dotFill'];\n const hasDotFill = dotFill && dotFill.length > 0;\n const lineColor = usedAesFromPalettes['lineColor'];\n const hasLineColor = lineColor && lineColor.length > 0;\n const getAesField = (category: Category, field: keyof AesItem) => {\n const inheritedResult = hasInheritedAes ? inheritedAes[category]?.[field] : undefined;\n \n if (field === 'dotFill' && hasDotFill) {\n return dotFill[categoryIndexer.getIndex(columnName, category) % dotFill.length] ?? inheritedResult;\n }\n if (field === 'lineColor' && hasLineColor) {\n return lineColor[categoryIndexer.getIndex(columnName, category) % lineColor.length] ?? inheritedResult;\n }\n \n return inheritedResult;\n };\n\n return getAesField;\n}\n\nfunction isInheritMapping<T extends (string | number)>(value:T | InheritAesScatterplot | ContinuousAesFromColumn<T>):value is InheritAesScatterplot {\n return typeof value === 'object' && 'type' in value && value.type === 'grouping';\n}\nexport function createLegendInfo(\n data: DataFrame,\n grouping: ScatterplotSettingsImpl['grouping'],\n layers: ScatterplotLayer[],\n): ScatterplotLegendInfo {\n return grouping.reduce((res: ScatterplotLegendInfo, groupingElement) => {\n // TODO: remove String conversion\n const column = groupingElement.columnName;\n const order = groupingElement.order;\n const getValueLabel = (index: number) => {\n return column.valueLabels\n ? data.getColumnValueCategory(column.valueLabels, index)\n : undefined;\n };\n\n const usedAes = new Set<keyof AesItem>();\n const usedAesFromPalettes:Partial<Record<keyof AesItem, string[]>> = {}; // if there is palette in mapping then\n layers.forEach(layer => {\n if (!layer.aes) return;\n \n Object.entries(layer.aes).forEach(([key, value]) => {\n if (!(isInheritMapping(value) && value.value === column.value)) return;\n \n usedAes.add(key as keyof AesItem);\n usedAesFromPalettes[key as keyof AesItem] = value.palette;\n });\n });\n let labels: Record<Category, string> = {};\n let values: Category[] = [];\n if (usedAes.has('dotFill') || usedAes.has('dotShape')) {\n const categories = data.getColumnCategories(column.value);\n if (categories.length < MAX_SHOWN_UNIQUE_VALUES_IN_LABELS) {\n labels = categories.reduce((res, category) => {\n const index = data.getColumnCategoryRowIndex(column.value, category);\n res[category] = getValueLabel(index) ?? category;\n return res;\n }, labels);\n const sortWeights = categories.reduce((res, v) => {\n res[v] = order?.indexOf(v) ?? -1;\n return res;\n }, {} as Record<string, number>);\n values = categories.sort((a, b) => {\n if (sortWeights[a] !== sortWeights[b]) {\n return sortWeights[a] - sortWeights[b];\n }\n return labels[a]?.localeCompare(labels[b] ?? '', 'en', {numeric: true}) ?? 0;\n });\n } else {\n values = categories;\n }\n }\n res[column.value] = {\n values,\n usedAes: [...usedAes],\n aesMap: addPalettesToAesMapping(column, usedAesFromPalettes, groupingElement.inheritedAes),\n labels,\n };\n return res;\n }, {});\n}"],"names":["categoryIndexer","map","columnName","category","categoryMap","index","addPalettesToAesMapping","usedAesFromPalettes","inheritedAes","hasInheritedAes","dotFill","hasDotFill","lineColor","hasLineColor","field","inheritedResult","_a","isInheritMapping","value","createLegendInfo","data","grouping","layers","res","groupingElement","column","order","getValueLabel","usedAes","layer","key","labels","values","categories","MAX_SHOWN_UNIQUE_VALUES_IN_LABELS","sortWeights","v","a","b"],"mappings":";AAcA,MAAMA,IAAmB,uBAAM;AAC3B,QAAMC,wBAAU,IAAA;AAgBhB,SAAO;AAAA,IACH,OAhBU,MAAMA,EAAI,MAAA;AAAA,IAiBpB,UAhBa,CAACC,GAAwBC,MAA+B;AACrE,UAAIC,IAAcH,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YAAY;AAAA,MACzF,QAAAO;AAAA,IAAA,GAEGR;AAAA,EACX,GAAG,CAAA,CAAE;AACT;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DataFrame } from '../../DataFrame';
|
|
2
|
+
import { ColumnName } from '../../types';
|
|
3
|
+
import { numberFormat } from '../../utils/numberFormat';
|
|
4
|
+
export declare function formatColumnValue(data: DataFrame, rowIdx: number, column: ColumnName | null | undefined, numberFormatter?: typeof numberFormat): string | null;
|
|
5
|
+
//# sourceMappingURL=formatColumnValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatColumnValue.d.ts","sourceRoot":"","sources":["../../../src/scatterplot/utils/formatColumnValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,IAAI,EAAC,SAAS,EAAE,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,UAAU,GAAG,IAAI,GAAG,SAAS,EAAE,eAAe,sBAAe,iBAUpI"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { numberFormat as l } from "../../utils/numberFormat.js";
|
|
2
|
+
function m(u, t, r, n = l) {
|
|
3
|
+
if (!r)
|
|
4
|
+
return null;
|
|
5
|
+
const e = u.getColumnValue(r.valueLabels ?? r.value, t);
|
|
6
|
+
return !(typeof e == "number") || e === null ? e : n(e);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
m as formatColumnValue
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=formatColumnValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatColumnValue.js","sources":["../../../src/scatterplot/utils/formatColumnValue.ts"],"sourcesContent":["import type {DataFrame} from '../../DataFrame';\nimport type {ColumnName} from '../../types';\nimport {numberFormat} from '../../utils/numberFormat';\n\nexport function formatColumnValue(data:DataFrame, rowIdx:number, column:ColumnName | null | undefined, numberFormatter = numberFormat) {\n if (!column) {\n return null;\n }\n const value = data.getColumnValue(column.valueLabels ?? column.value, rowIdx);\n const isNumber = typeof value === 'number';\n if (!isNumber || value === null) {\n return value;\n }\n return numberFormatter(value);\n}"],"names":["formatColumnValue","data","rowIdx","column","numberFormatter","numberFormat","value"],"mappings":";AAIO,SAASA,EAAkBC,GAAgBC,GAAeC,GAAsCC,IAAkBC,GAAc;AACnI,MAAI,CAACF;AACD,WAAO;AAEX,QAAMG,IAAQL,EAAK,eAAeE,EAAO,eAAeA,EAAO,OAAOD,CAAM;AAE5E,SAAI,EADa,OAAOI,KAAU,aACjBA,MAAU,OAChBA,IAEJF,EAAgBE,CAAK;AAChC;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DataFrame } from '../../DataFrame';
|
|
2
|
+
import { ColumnName, DataValue } from '../../types';
|
|
3
|
+
import { Dot } from '../dots';
|
|
4
|
+
export declare function sortDotsByGrouping(dataFrame: DataFrame, dots: Dot[], grouping: {
|
|
5
|
+
columnName: ColumnName;
|
|
6
|
+
order?: DataValue[];
|
|
7
|
+
}[], highlight: ColumnName | null): void;
|
|
8
|
+
//# sourceMappingURL=sortDotsByGrouping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortDotsByGrouping.d.ts","sourceRoot":"","sources":["../../../src/scatterplot/utils/sortDotsByGrouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,SAAS,CAAC;AAEjC,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAC,GAAG,EAAE,EACV,QAAQ,EAAE;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CAAC,EAAE,EAC1D,SAAS,EAAE,UAAU,GAAG,IAAI,QA2B/B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function v(r, s, i, f) {
|
|
2
|
+
const c = i.reduce((t, { columnName: n, order: e }) => (e && (t[n.value] = e.reduce((o, u, l) => (o[u] = e.length - l, o), {})), t), {});
|
|
3
|
+
s.sort((t, n) => {
|
|
4
|
+
var e, o;
|
|
5
|
+
if (f && n.dimmed !== t.dimmed)
|
|
6
|
+
return n.dimmed ? 1 : -1;
|
|
7
|
+
for (const { columnName: u } of i) {
|
|
8
|
+
const l = r.getColumnValue(u.value, t.idx), d = r.getColumnValue(u.value, n.idx), m = (e = c[u.value]) == null ? void 0 : e[l], a = (o = c[u.value]) == null ? void 0 : o[d];
|
|
9
|
+
if (m !== a)
|
|
10
|
+
return m - a;
|
|
11
|
+
}
|
|
12
|
+
return 0;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
v as sortDotsByGrouping
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=sortDotsByGrouping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortDotsByGrouping.js","sources":["../../../src/scatterplot/utils/sortDotsByGrouping.ts"],"sourcesContent":["import type {DataFrame} from '../../DataFrame';\nimport type {ColumnName, DataValue} from '../../types';\nimport type {Dot} from '../dots';\n\nexport function sortDotsByGrouping(\n dataFrame: DataFrame,\n dots:Dot[],\n grouping: {columnName: ColumnName; order?: DataValue[];}[],\n highlight: ColumnName | null\n) {\n const weightsByColumnByOrder = grouping.reduce((res, {columnName, order}) => {\n if (order) {\n res[columnName.value] = order.reduce((weights, orderEl, idx) => {\n weights[orderEl as string] = order.length - idx;\n return weights;\n }, {} as Record<string, number>);\n }\n return res;\n }, {} as Record<string, Record<string, number>>);\n\n dots.sort((d1, d2) => {\n if (highlight && d2.dimmed !== d1.dimmed) {\n return d2.dimmed ? 1 : -1;\n }\n for (const {columnName} of grouping) {\n const aValue = dataFrame.getColumnValue(columnName.value, d1.idx);\n const bValue = dataFrame.getColumnValue(columnName.value, d2.idx);\n const aWeight = weightsByColumnByOrder[columnName.value]?.[aValue as string];\n const bWeight = weightsByColumnByOrder[columnName.value]?.[bValue as string];\n if (aWeight !== bWeight) {\n return aWeight - bWeight;\n }\n }\n return 0;\n });\n}"],"names":["sortDotsByGrouping","dataFrame","dots","grouping","highlight","weightsByColumnByOrder","res","columnName","order","weights","orderEl","idx","d1","d2","_a","_b","aValue","bValue","aWeight","bWeight"],"mappings":"AAIO,SAASA,EACZC,GACAC,GACAC,GACAC,GACF;AACE,QAAMC,IAAyBF,EAAS,OAAO,CAACG,GAAK,EAAC,YAAAC,GAAY,OAAAC,SAC1DA,MACAF,EAAIC,EAAW,KAAK,IAAIC,EAAM,OAAO,CAACC,GAASC,GAASC,OACpDF,EAAQC,CAAiB,IAAIF,EAAM,SAASG,GACrCF,IACR,CAAA,CAA4B,IAE5BH,IACR,CAAA,CAA4C;AAE/C,EAAAJ,EAAK,KAAK,CAACU,GAAIC,MAAO;AAhBnB,QAAAC,GAAAC;AAiBC,QAAIX,KAAaS,EAAG,WAAWD,EAAG;AAC9B,aAAOC,EAAG,SAAS,IAAI;AAE3B,eAAW,EAAC,YAAAN,EAAA,KAAeJ,GAAU;AACjC,YAAMa,IAASf,EAAU,eAAeM,EAAW,OAAOK,EAAG,GAAG,GAC1DK,IAAShB,EAAU,eAAeM,EAAW,OAAOM,EAAG,GAAG,GAC1DK,KAAUJ,IAAAT,EAAuBE,EAAW,KAAK,MAAvC,gBAAAO,EAA2CE,IACrDG,KAAUJ,IAAAV,EAAuBE,EAAW,KAAK,MAAvC,gBAAAQ,EAA2CE;AAC3D,UAAIC,MAAYC;AACZ,eAAOD,IAAUC;AAAA,IAEzB;AACA,WAAO;AAAA,EACX,CAAC;AACL;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScatterplotAxisSettings } from '../scatterplot/ScatterplotSettingsImpl';
|
|
2
|
-
import { ColumnName, ContinuousAesFromColumn, FrameType, LegendPosition, LineShape, SettingsInterface, TitlePosition, AesRecord, InheritAesScatterplot, PointShape } from '../types';
|
|
2
|
+
import { ColumnName, ContinuousAesFromColumn, DataValue, FrameType, LegendPosition, LineShape, SettingsInterface, TitlePosition, AesRecord, InheritAesScatterplot, PointShape } from '../types';
|
|
3
3
|
import { CurveUmapLayer as OuterCurveLayer, DotsUmapLayer as OuterDotsLayer, ScatterplotUmapSettings } from '../types/scatterplot-umap';
|
|
4
4
|
export declare class DotsLayer {
|
|
5
5
|
readonly type = "dots";
|
|
@@ -29,7 +29,11 @@ export declare class ScatterplotUmapSettingsImpl implements SettingsInterface {
|
|
|
29
29
|
readonly keyColumn: ColumnName | null;
|
|
30
30
|
readonly x: ColumnName;
|
|
31
31
|
readonly y: ColumnName;
|
|
32
|
-
readonly grouping:
|
|
32
|
+
readonly grouping: {
|
|
33
|
+
columnName: ColumnName;
|
|
34
|
+
order?: DataValue[];
|
|
35
|
+
inheritedAes?: AesRecord;
|
|
36
|
+
}[];
|
|
33
37
|
readonly label: ColumnName | null;
|
|
34
38
|
readonly highlight: ColumnName | null;
|
|
35
39
|
readonly chartSettings: {
|
|
@@ -56,7 +60,6 @@ export declare class ScatterplotUmapSettingsImpl implements SettingsInterface {
|
|
|
56
60
|
content?: ColumnName[];
|
|
57
61
|
};
|
|
58
62
|
};
|
|
59
|
-
readonly inheritedAes: Record<string, AesRecord>;
|
|
60
63
|
readonly layers: ScatterplotUmapLayer[];
|
|
61
64
|
constructor(settings: ScatterplotUmapSettings);
|
|
62
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsImpl.d.ts","sourceRoot":"","sources":["../../src/scatterplot-umap/SettingsImpl.ts"],"names":[],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AAQ,EAAE,cAAc,CAAA;SAAC,CAAC;QAC3D,QAAQ,CAAC,QAAQ,EAAE;YAAC,IAAI,EAAE,OAAO,CAAC;YAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;SAAC,CAAC;KAC9D,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC;gBAE5B,QAAQ,EAAE,uBAAuB;CA0DhD"}
|
|
@@ -1,101 +1,100 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_HEIGHT as
|
|
6
|
-
import { ScatterplotUmapSettingsSchema as
|
|
7
|
-
class
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
dotFill:
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var y = (l, o, r) => o in l ? m(l, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : l[o] = r;
|
|
3
|
+
var e = (l, o, r) => y(l, typeof o != "symbol" ? o + "" : o, r);
|
|
4
|
+
import s from "../node_modules/lodash/lodash.js";
|
|
5
|
+
import { DEFAULT_HEIGHT as d, DEFAULT_WIDTH as n, BLACK as c } from "../constants.js";
|
|
6
|
+
import { ScatterplotUmapSettingsSchema as w } from "../types/scatterplot-umap.js";
|
|
7
|
+
class x {
|
|
8
|
+
constructor(o) {
|
|
9
|
+
e(this, "type", "dots");
|
|
10
|
+
e(this, "aes", {
|
|
11
|
+
dotFill: c,
|
|
12
12
|
dotShape: "21",
|
|
13
13
|
dotSize: 3,
|
|
14
14
|
opacity: 1
|
|
15
15
|
});
|
|
16
16
|
this.aes = {
|
|
17
17
|
...this.aes,
|
|
18
|
-
...
|
|
18
|
+
...o.aes
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
23
|
-
constructor(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
lineColor:
|
|
22
|
+
class f {
|
|
23
|
+
constructor(o) {
|
|
24
|
+
e(this, "type", "curve");
|
|
25
|
+
e(this, "smoothing");
|
|
26
|
+
e(this, "aes", {
|
|
27
|
+
lineColor: c,
|
|
28
28
|
lineWidth: 1,
|
|
29
29
|
lineShape: "solid",
|
|
30
30
|
opacity: 1
|
|
31
31
|
});
|
|
32
|
-
this.smoothing =
|
|
32
|
+
this.smoothing = o.smoothing ?? !1, this.aes = {
|
|
33
33
|
...this.aes,
|
|
34
|
-
...
|
|
34
|
+
...o.aes
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class
|
|
39
|
-
constructor(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
d.parse(e), this.id = m.uniqueId("settings"), this.keyColumn = e.keyColumn ?? null, this.x = e.x, this.y = e.y, this.grouping = e.grouping ?? [], this.label = e.label ?? null, this.highlight = e.highlight ?? null, this.chartSettings = {
|
|
38
|
+
class T {
|
|
39
|
+
constructor(o) {
|
|
40
|
+
e(this, "id");
|
|
41
|
+
e(this, "type", "scatterplot-umap");
|
|
42
|
+
e(this, "keyColumn");
|
|
43
|
+
e(this, "x");
|
|
44
|
+
e(this, "y");
|
|
45
|
+
e(this, "grouping");
|
|
46
|
+
e(this, "label");
|
|
47
|
+
e(this, "highlight");
|
|
48
|
+
e(this, "chartSettings");
|
|
49
|
+
e(this, "layers");
|
|
50
|
+
var r, i, a, t, p, u;
|
|
51
|
+
w.parse(o), this.id = s.uniqueId("settings"), this.keyColumn = o.keyColumn ?? null, this.x = o.x, this.y = o.y, this.grouping = o.grouping ?? [], this.label = o.label ?? null, this.highlight = o.highlight ?? null, this.chartSettings = {
|
|
53
52
|
size: {
|
|
54
|
-
width: ((
|
|
55
|
-
height: ((
|
|
53
|
+
width: ((r = o == null ? void 0 : o.size) == null ? void 0 : r.width) ?? n,
|
|
54
|
+
height: ((i = o == null ? void 0 : o.size) == null ? void 0 : i.height) ?? d
|
|
56
55
|
},
|
|
57
56
|
title: {
|
|
58
57
|
position: "center",
|
|
59
58
|
show: !0,
|
|
60
|
-
...
|
|
61
|
-
name: ((
|
|
59
|
+
...o.title,
|
|
60
|
+
name: ((a = o.title) == null ? void 0 : a.name) ?? "Chart"
|
|
62
61
|
},
|
|
63
62
|
yAxis: {
|
|
64
|
-
title:
|
|
63
|
+
title: o.y.label ?? o.y.value,
|
|
65
64
|
scale: "linear",
|
|
66
65
|
showGrid: !0,
|
|
67
66
|
showTicks: !0,
|
|
68
|
-
...
|
|
67
|
+
...o.yAxis
|
|
69
68
|
},
|
|
70
69
|
xAxis: {
|
|
71
|
-
title:
|
|
70
|
+
title: o.x.label ?? o.x.value,
|
|
72
71
|
scale: "linear",
|
|
73
72
|
showGrid: !0,
|
|
74
73
|
showTicks: !0,
|
|
75
|
-
...
|
|
74
|
+
...o.xAxis
|
|
76
75
|
},
|
|
77
|
-
frame: { type: ((
|
|
76
|
+
frame: { type: ((t = o.frame) == null ? void 0 : t.type) ?? "full" },
|
|
78
77
|
legend: {
|
|
79
78
|
show: !0,
|
|
80
79
|
position: "right",
|
|
81
|
-
...
|
|
80
|
+
...o.legend
|
|
82
81
|
},
|
|
83
82
|
tooltips: {
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
...o.tooltips,
|
|
84
|
+
show: ((p = o.tooltips) == null ? void 0 : p.show) !== !1 && (((u = o.tooltips) == null ? void 0 : u.content) ?? []).length > 0
|
|
86
85
|
}
|
|
87
|
-
}, this.
|
|
88
|
-
if (
|
|
89
|
-
return new
|
|
90
|
-
if (
|
|
91
|
-
return new
|
|
86
|
+
}, this.layers = o.layers.map((h) => {
|
|
87
|
+
if (h.type === "dots")
|
|
88
|
+
return new x(h);
|
|
89
|
+
if (h.type === "curve")
|
|
90
|
+
return new f(h);
|
|
92
91
|
throw new Error("Unknown layer type");
|
|
93
92
|
}).filter(Boolean);
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
f as CurveLayer,
|
|
97
|
+
x as DotsLayer,
|
|
98
|
+
T as ScatterplotUmapSettingsImpl
|
|
100
99
|
};
|
|
101
100
|
//# sourceMappingURL=SettingsImpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsImpl.js","sources":["../../src/scatterplot-umap/SettingsImpl.ts"],"sourcesContent":["import lodash from 'lodash';\nimport { BLACK, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../constants';\nimport type { ScatterplotAxisSettings } from '../scatterplot/ScatterplotSettingsImpl';\nimport type {\n ColumnName,\n ContinuousAesFromColumn,\n FrameType,\n LegendPosition,\n LineShape,\n SettingsInterface,\n TitlePosition
|
|
1
|
+
{"version":3,"file":"SettingsImpl.js","sources":["../../src/scatterplot-umap/SettingsImpl.ts"],"sourcesContent":["import lodash from 'lodash';\nimport { BLACK, DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../constants';\nimport type { ScatterplotAxisSettings } from '../scatterplot/ScatterplotSettingsImpl';\nimport type {\n ColumnName,\n ContinuousAesFromColumn,\n DataValue,\n FrameType,\n LegendPosition,\n LineShape,\n SettingsInterface,\n TitlePosition\n} from '../types';\nimport {type AesRecord, type InheritAesScatterplot, type PointShape} from '../types';\nimport type {\n CurveUmapLayer as OuterCurveLayer,\n DotsUmapLayer as OuterDotsLayer,\n ScatterplotUmapSettings\n} from '../types/scatterplot-umap';\nimport { ScatterplotUmapSettingsSchema } from '../types/scatterplot-umap';\n\nexport class DotsLayer {\n readonly type = 'dots';\n readonly aes: {\n dotFill: string | InheritAesScatterplot | ContinuousAesFromColumn<string>;\n dotShape: PointShape | InheritAesScatterplot;\n dotSize: number | ContinuousAesFromColumn<number>;\n opacity: number;\n } = {\n dotFill: BLACK,\n dotShape: '21',\n dotSize: 3,\n opacity: 1,\n };\n constructor(layer: OuterDotsLayer) {\n this.aes = {\n ...this.aes,\n ...layer.aes,\n };\n }\n}\nexport class CurveLayer {\n readonly type = 'curve';\n readonly smoothing: boolean;\n readonly aes: {\n lineColor: string | InheritAesScatterplot | ContinuousAesFromColumn<string>;\n lineWidth: number;\n lineShape: LineShape;\n opacity: number;\n } = {\n lineColor: BLACK,\n lineWidth: 1,\n lineShape: 'solid',\n opacity: 1,\n };\n\n constructor(layer: OuterCurveLayer) {\n this.smoothing = layer.smoothing ?? false;\n this.aes = {\n ...this.aes,\n ...layer.aes,\n };\n }\n}\n\nexport type ScatterplotUmapLayer = DotsLayer | CurveLayer;\n\nexport class ScatterplotUmapSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'scatterplot-umap';\n readonly keyColumn: ColumnName | null;\n readonly x: ColumnName;\n readonly y: ColumnName;\n readonly grouping: {\n columnName: ColumnName;\n order?: DataValue[];\n inheritedAes?: AesRecord;\n }[];\n readonly label: ColumnName | null;\n readonly highlight: ColumnName | null;\n readonly chartSettings: {\n readonly size: {width: number; height: number};\n readonly title: {name: string; show: boolean; position: TitlePosition};\n readonly yAxis: ScatterplotAxisSettings;\n readonly xAxis: ScatterplotAxisSettings;\n readonly frame: {type: FrameType};\n readonly legend: {show: boolean; position: LegendPosition};\n readonly tooltips: {show: boolean; content?: ColumnName[]};\n };\n readonly layers: ScatterplotUmapLayer[];\n\n constructor(settings: ScatterplotUmapSettings) {\n ScatterplotUmapSettingsSchema.parse(settings);\n this.id = lodash.uniqueId('settings');\n this.keyColumn = settings.keyColumn ?? null;\n this.x = settings.x;\n this.y = settings.y;\n this.grouping = settings.grouping ?? [];\n this.label = settings.label ?? null;\n this.highlight = settings.highlight ?? null;\n this.chartSettings = {\n size: {\n width: settings?.size?.width ?? DEFAULT_WIDTH,\n height: settings?.size?.height ?? DEFAULT_HEIGHT,\n },\n title: {\n position: 'center',\n show: true,\n ...settings.title,\n name: settings.title?.name ?? 'Chart',\n },\n yAxis: {\n title: settings.y.label ?? settings.y.value,\n scale: 'linear',\n showGrid: true,\n showTicks: true,\n ...settings.yAxis,\n },\n xAxis: {\n title: settings.x.label ?? settings.x.value,\n scale: 'linear',\n showGrid: true,\n showTicks: true,\n ...settings.xAxis,\n },\n frame: {type: settings.frame?.type ?? 'full'},\n legend: {\n show: true,\n position: 'right',\n ...settings.legend,\n },\n tooltips: {\n ...settings.tooltips,\n show: !(settings.tooltips?.show === false) && (settings.tooltips?.content ?? []).length > 0,\n },\n };\n\n this.layers = settings.layers\n .map(layer => {\n if (layer.type === 'dots') {\n return new DotsLayer(layer);\n } else if (layer.type === 'curve') {\n return new CurveLayer(layer);\n } else {\n throw new Error('Unknown layer type');\n }\n })\n .filter(Boolean) as ScatterplotUmapLayer[];\n }\n}\n"],"names":["DotsLayer","layer","__publicField","BLACK","CurveLayer","ScatterplotUmapSettingsImpl","settings","ScatterplotUmapSettingsSchema","lodash","_a","DEFAULT_WIDTH","_b","DEFAULT_HEIGHT","_c","_d","_e","_f"],"mappings":";;;;;;AAqBO,MAAMA,EAAU;AAAA,EAanB,YAAYC,GAAuB;AAZ1B,IAAAC,EAAA,cAAO;AACP,IAAAA,EAAA,aAKL;AAAA,MACA,SAASC;AAAA,MACT,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,IAAA;AAGT,SAAK,MAAM;AAAA,MACP,GAAG,KAAK;AAAA,MACR,GAAGF,EAAM;AAAA,IAAA;AAAA,EAEjB;AACJ;AACO,MAAMG,EAAW;AAAA,EAepB,YAAYH,GAAwB;AAd3B,IAAAC,EAAA,cAAO;AACP,IAAAA,EAAA;AACA,IAAAA,EAAA,aAKL;AAAA,MACA,WAAWC;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MACX,SAAS;AAAA,IAAA;AAIT,SAAK,YAAYF,EAAM,aAAa,IACpC,KAAK,MAAM;AAAA,MACP,GAAG,KAAK;AAAA,MACR,GAAGA,EAAM;AAAA,IAAA;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BAAAQ,EAAgB,SAAQ,OAAA;AAAA,MACtC,QAAQ;AAAA,QACJ,MAAM;AAAA,QACN,UAAU;AAAA,QACV,GAAGR,EAAS;AAAA,MAAA;AAAA,MAEhB,UAAU;AAAA,QACN,GAAGA,EAAS;AAAA,QACZ,QAAQS,IAAAT,EAAS,aAAT,gBAAAS,EAAmB,UAAS,SAAWC,IAAAV,EAAS,aAAT,gBAAAU,EAAmB,YAAW,CAAA,GAAI,SAAS;AAAA,MAAA;AAAA,IAC9F,GAGJ,KAAK,SAASV,EAAS,OAClB,IAAI,CAAAL,MAAS;AACV,UAAIA,EAAM,SAAS;AACf,eAAO,IAAID,EAAUC,CAAK;AAC9B,UAAWA,EAAM,SAAS;AACtB,eAAO,IAAIG,EAAWH,CAAK;AAE3B,YAAM,IAAI,MAAM,oBAAoB;AAAA,IAE5C,CAAC,EACA,OAAO,OAAO;AAAA,EACvB;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LowerSVG.d.ts","sourceRoot":"","sources":["../../../src/scatterplot-umap/components/LowerSVG.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LowerSVG.d.ts","sourceRoot":"","sources":["../../../src/scatterplot-umap/components/LowerSVG.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoB7G,iBAAS,QAAQ,CAAC,EACd,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACd,EAAE;IACC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC5D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACtC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC9C,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CACtC,kDAgKA;;AAED,wBAAoC"}
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { ChartsTitle as
|
|
4
|
-
import { ContinuousGrid as
|
|
1
|
+
import { j as o } from "../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import N, { r as g } from "../../_virtual/index.js";
|
|
3
|
+
import { ChartsTitle as O } from "../../common/ChartsTitle.js";
|
|
4
|
+
import { ContinuousGrid as R } from "../../common/ContinuousGrid.js";
|
|
5
5
|
import M from "../../common/fonts.js";
|
|
6
6
|
import { Legend as U } from "../../common/Legend.js";
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { useDataFrame as
|
|
9
|
-
import { BLACK as
|
|
10
|
-
import { Axis as
|
|
11
|
-
import {
|
|
12
|
-
import { DEFAULT_TICKS_SIZE as
|
|
7
|
+
import { Tooltip as V } from "../../common/Tooltip.js";
|
|
8
|
+
import { useDataFrame as Z } from "../../common/useDataFrame.js";
|
|
9
|
+
import { BLACK as q } from "../../constants.js";
|
|
10
|
+
import { Axis as E } from "../../scatterplot/components/Axis.js";
|
|
11
|
+
import { formatColumnValue as G } from "../../scatterplot/utils/formatColumnValue.js";
|
|
12
|
+
import { DEFAULT_TICKS_SIZE as H, TITLE_LINE as u, LEGEND_OFFSET as J } from "../constants.js";
|
|
13
13
|
import Q from "../../node_modules/d3-shape/src/line.js";
|
|
14
14
|
import S from "../../node_modules/d3-shape/src/curve/basis.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
for (const
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
import { format as z } from "../../node_modules/d3-format/src/defaultLocale.js";
|
|
16
|
+
function tt(i, d, m = []) {
|
|
17
|
+
const a = [];
|
|
18
|
+
for (const e of m) {
|
|
19
|
+
const t = e != null && e.format ? z(e.format) : void 0;
|
|
20
|
+
a.push(`${e.label}: ${G(i, d.idx, e, t)}`);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
21
23
|
}
|
|
22
|
-
function
|
|
23
|
-
return typeof
|
|
24
|
+
function F(i) {
|
|
25
|
+
return typeof i == "string" ? i : i.label ?? i.value;
|
|
24
26
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
scales:
|
|
28
|
-
chartSettings:
|
|
29
|
-
mainTitle:
|
|
30
|
-
keyColumn:
|
|
31
|
-
margins:
|
|
27
|
+
const L = Q().curve(S);
|
|
28
|
+
function ot({
|
|
29
|
+
scales: i,
|
|
30
|
+
chartSettings: d,
|
|
31
|
+
mainTitle: m,
|
|
32
|
+
keyColumn: a,
|
|
33
|
+
margins: e,
|
|
32
34
|
chartSizes: t,
|
|
33
35
|
container: j,
|
|
34
36
|
zoomStateKey: y,
|
|
35
|
-
legendData:
|
|
36
|
-
dotsByGrouping:
|
|
37
|
-
layers:
|
|
38
|
-
aesGetters:
|
|
39
|
-
tooltipData:
|
|
37
|
+
legendData: P,
|
|
38
|
+
dotsByGrouping: b,
|
|
39
|
+
layers: A,
|
|
40
|
+
aesGetters: x,
|
|
41
|
+
tooltipData: h
|
|
40
42
|
}) {
|
|
41
|
-
var
|
|
42
|
-
const
|
|
43
|
+
var v;
|
|
44
|
+
const D = Z(), { title: w, xAxis: p, yAxis: c, frame: B, legend: I } = d, _ = p.showTicks ? H : 0, X = c.showTicks ? H : 0, T = p.title, W = c.title, Y = {
|
|
43
45
|
left: 0,
|
|
44
46
|
right: t.chartWidth,
|
|
45
47
|
top: 0,
|
|
@@ -47,20 +49,20 @@ function tt({
|
|
|
47
49
|
};
|
|
48
50
|
if (!j)
|
|
49
51
|
return null;
|
|
50
|
-
const
|
|
51
|
-
function
|
|
52
|
-
const f = Object.entries(
|
|
53
|
-
key:
|
|
54
|
-
d:
|
|
52
|
+
const n = A.find((r) => r.type === "curve"), [k, K] = g.useState([]);
|
|
53
|
+
function $() {
|
|
54
|
+
const f = Object.entries(b).map(([s, l]) => ({
|
|
55
|
+
key: s,
|
|
56
|
+
d: n != null && n.smoothing ? L(l) ?? "" : l.map((C) => `${i.x(C.x)},${i.y(C.y)}`).join(" "),
|
|
55
57
|
dot: l[0]
|
|
56
58
|
}));
|
|
57
|
-
|
|
59
|
+
K(f);
|
|
58
60
|
}
|
|
59
61
|
return g.useEffect(() => {
|
|
60
|
-
|
|
62
|
+
n && (L.x((r) => i.x(r.x)).y((r) => i.y(r.y)), $());
|
|
61
63
|
}, [y, t.chartWidth, t.chartHeight]), g.useEffect(() => {
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
+
n && $();
|
|
65
|
+
}, [n == null ? void 0 : n.smoothing]), /* @__PURE__ */ o.jsxs(
|
|
64
66
|
"svg",
|
|
65
67
|
{
|
|
66
68
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -69,103 +71,103 @@ function tt({
|
|
|
69
71
|
height: t.totalHeight,
|
|
70
72
|
style: { pointerEvents: "none" },
|
|
71
73
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
74
|
+
/* @__PURE__ */ o.jsx("defs", { children: M }),
|
|
75
|
+
/* @__PURE__ */ o.jsxs("g", { transform: `translate(${e.left},${e.top})`, fontFamily: "Manrope", children: [
|
|
76
|
+
/* @__PURE__ */ o.jsx("clipPath", { id: "viewportClipPath", children: /* @__PURE__ */ o.jsx("rect", { x: "0", y: "0", width: t.chartWidth, height: t.chartHeight }) }),
|
|
77
|
+
/* @__PURE__ */ o.jsx(
|
|
78
|
+
O,
|
|
77
79
|
{
|
|
78
|
-
title:
|
|
80
|
+
title: m,
|
|
79
81
|
show: w.show,
|
|
80
82
|
position: w.position,
|
|
81
|
-
leftPadding:
|
|
82
|
-
rightPadding:
|
|
83
|
+
leftPadding: e.left,
|
|
84
|
+
rightPadding: e.right,
|
|
83
85
|
chartsWidth: t.chartWidth
|
|
84
86
|
}
|
|
85
87
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
+
/* @__PURE__ */ o.jsxs("g", { dominantBaseline: "central", textAnchor: "middle", fontWeight: "500", fontSize: "14px", fill: q, children: [
|
|
89
|
+
T && /* @__PURE__ */ o.jsx(
|
|
88
90
|
"text",
|
|
89
91
|
{
|
|
90
92
|
x: t.chartWidth / 2,
|
|
91
|
-
y: t.chartHeight +
|
|
92
|
-
children:
|
|
93
|
+
y: t.chartHeight + e.bottom - u / 2,
|
|
94
|
+
children: F(T)
|
|
93
95
|
}
|
|
94
96
|
),
|
|
95
|
-
|
|
97
|
+
W && /* @__PURE__ */ o.jsx(
|
|
96
98
|
"text",
|
|
97
99
|
{
|
|
98
|
-
x: -
|
|
100
|
+
x: -e.left + u / 2,
|
|
99
101
|
y: t.chartHeight / 2,
|
|
100
|
-
transform: `rotate(-90,${-
|
|
101
|
-
children:
|
|
102
|
+
transform: `rotate(-90,${-e.left + u / 2},${t.chartHeight / 2})`,
|
|
103
|
+
children: F(W)
|
|
102
104
|
}
|
|
103
105
|
)
|
|
104
106
|
] }),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
107
|
+
/* @__PURE__ */ o.jsx(
|
|
108
|
+
R,
|
|
107
109
|
{
|
|
108
110
|
width: t.chartWidth,
|
|
109
111
|
height: t.chartHeight,
|
|
110
|
-
scaleX:
|
|
111
|
-
scaleY:
|
|
112
|
+
scaleX: i.x,
|
|
113
|
+
scaleY: i.y,
|
|
112
114
|
axisX: p,
|
|
113
|
-
axisY:
|
|
115
|
+
axisY: c,
|
|
114
116
|
updatingKey: y,
|
|
115
|
-
frameType:
|
|
117
|
+
frameType: B.type
|
|
116
118
|
}
|
|
117
119
|
),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
120
|
+
/* @__PURE__ */ o.jsx("g", { transform: `translate(0,${t.chartHeight})`, children: /* @__PURE__ */ o.jsx(E, { scale: i.x, orient: "bottom", tickSize: _ }) }),
|
|
121
|
+
/* @__PURE__ */ o.jsx("g", { children: /* @__PURE__ */ o.jsx(E, { scale: i.y, orient: "left", tickSize: X }) }),
|
|
122
|
+
n && n.smoothing && /* @__PURE__ */ o.jsx("g", { clipPath: "url(#viewportClipPath)", children: k.map(({ key: r, d: f, dot: s }) => {
|
|
121
123
|
var l;
|
|
122
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ o.jsx(
|
|
123
125
|
"path",
|
|
124
126
|
{
|
|
125
127
|
d: f,
|
|
126
128
|
fill: "none",
|
|
127
|
-
stroke:
|
|
128
|
-
strokeWidth: (l =
|
|
129
|
-
strokeDasharray:
|
|
129
|
+
stroke: x.dotFill(s.idx),
|
|
130
|
+
strokeWidth: (l = n.aes) == null ? void 0 : l.lineWidth,
|
|
131
|
+
strokeDasharray: x.lineType(s.idx)
|
|
130
132
|
},
|
|
131
133
|
r
|
|
132
134
|
);
|
|
133
135
|
}) }),
|
|
134
|
-
|
|
136
|
+
n && !n.smoothing && /* @__PURE__ */ o.jsx("g", { clipPath: "url(#viewportClipPath)", children: k.map(({ key: r, d: f, dot: s }) => {
|
|
135
137
|
var l;
|
|
136
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ o.jsx(
|
|
137
139
|
"polyline",
|
|
138
140
|
{
|
|
139
141
|
points: f,
|
|
140
142
|
fill: "none",
|
|
141
|
-
stroke:
|
|
142
|
-
strokeWidth: (l =
|
|
143
|
-
strokeDasharray:
|
|
143
|
+
stroke: x.dotFill(s.idx),
|
|
144
|
+
strokeWidth: (l = n.aes) == null ? void 0 : l.lineWidth,
|
|
145
|
+
strokeDasharray: x.lineType(s.idx)
|
|
144
146
|
},
|
|
145
147
|
r
|
|
146
148
|
);
|
|
147
149
|
}) }),
|
|
148
|
-
d.selectedData && /* @__PURE__ */
|
|
149
|
-
|
|
150
|
+
d.tooltips.show && h.selectedData && /* @__PURE__ */ o.jsx(
|
|
151
|
+
V,
|
|
150
152
|
{
|
|
151
|
-
content:
|
|
152
|
-
x:
|
|
153
|
-
y:
|
|
153
|
+
content: tt(D, h.selectedData, (v = d.tooltips) == null ? void 0 : v.content),
|
|
154
|
+
x: i.x(h.selectedData.x),
|
|
155
|
+
y: i.y(h.selectedData.y),
|
|
154
156
|
active: !0,
|
|
155
|
-
fixed:
|
|
156
|
-
sideDistances:
|
|
157
|
+
fixed: h.fixed,
|
|
158
|
+
sideDistances: Y,
|
|
157
159
|
container: j,
|
|
158
|
-
onClose:
|
|
160
|
+
onClose: h.onClose
|
|
159
161
|
}
|
|
160
162
|
),
|
|
161
|
-
|
|
163
|
+
I.show && /* @__PURE__ */ o.jsx("g", { transform: `translate(${t.chartWidth + J},0)`, children: /* @__PURE__ */ o.jsx(U, { legendData: P }) })
|
|
162
164
|
] })
|
|
163
165
|
]
|
|
164
166
|
}
|
|
165
167
|
);
|
|
166
168
|
}
|
|
167
|
-
const
|
|
169
|
+
const ut = N.memo(ot);
|
|
168
170
|
export {
|
|
169
|
-
|
|
171
|
+
ut as default
|
|
170
172
|
};
|
|
171
173
|
//# sourceMappingURL=LowerSVG.js.map
|