buckaroo-js-core 0.8.4 → 0.11.7
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/LICENSE +24 -12
- package/README.md +55 -51
- package/dist/index.cjs.js +114 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +60790 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.esm.js +60790 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/jest.setup.d.ts +0 -0
- package/dist/src/SampleComponent.d.ts +10 -0
- package/{buckaroo_js → dist/src}/baked_data/colorMap.d.ts +0 -1
- package/dist/src/baked_data/olympic-winners.d.ts +12 -0
- package/dist/src/components/BuckarooInfiniteWidget.flash.test.d.ts +1 -0
- package/dist/src/components/BuckarooStaticTable.d.ts +26 -0
- package/dist/src/components/BuckarooWidgetInfinite.d.ts +38 -0
- package/{buckaroo_js → dist/src}/components/ColumnsEditor.d.ts +5 -8
- package/{buckaroo_js → dist/src}/components/CommandUtils.d.ts +8 -5
- package/dist/src/components/DCFCell.d.ts +19 -0
- package/dist/src/components/DFViewerParts/ChartCell.d.ts +43 -0
- package/dist/src/components/DFViewerParts/DFViewerConfigs.d.ts +5 -0
- package/dist/src/components/DFViewerParts/DFViewerDataHelper.d.ts +20 -0
- package/dist/src/components/DFViewerParts/DFViewerInfinite.d.ts +43 -0
- package/dist/src/components/DFViewerParts/DFViewerInfinite.flash.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/DFViewerInfinite.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/DFWhole.d.ts +173 -0
- package/{buckaroo_js → dist/src}/components/DFViewerParts/Displayer.d.ts +20 -6
- package/dist/src/components/DFViewerParts/HistogramCell.d.ts +29 -0
- package/dist/src/components/DFViewerParts/HistogramCell.hooks.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/OtherRenderers.d.ts +5 -0
- package/dist/src/components/DFViewerParts/RowCache.d.ts +61 -0
- package/dist/src/components/DFViewerParts/RowCache.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/RowStore.d.ts +22 -0
- package/dist/src/components/DFViewerParts/RowStore.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/RowStoreGc.d.ts +22 -0
- package/dist/src/components/DFViewerParts/RowStoreGc.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/SeriesSummaryTooltip.d.ts +13 -0
- package/dist/src/components/DFViewerParts/SmartRowCache.d.ts +83 -0
- package/dist/src/components/DFViewerParts/SmartRowCache.test.d.ts +23 -0
- package/dist/src/components/DFViewerParts/Styler.d.ts +33 -0
- package/dist/src/components/DFViewerParts/TableInfinite.d.ts +10 -0
- package/dist/src/components/DFViewerParts/ViewRegistry.d.ts +21 -0
- package/dist/src/components/DFViewerParts/ViewRegistry.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/Views.d.ts +53 -0
- package/dist/src/components/DFViewerParts/Views.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/autocleaning.toggle.integration.test.d.ts +27 -0
- package/dist/src/components/DFViewerParts/gridUtils.d.ts +81 -0
- package/dist/src/components/DFViewerParts/gridUtils.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/resolveDFData.d.ts +29 -0
- package/dist/src/components/DFViewerParts/resolveDFData.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/xorqWindow.dom.test.d.ts +1 -0
- package/dist/src/components/DFViewerParts/xorqWindow.test.d.ts +1 -0
- package/{buckaroo_js → dist/src}/components/DependentTabs.d.ts +8 -13
- package/dist/src/components/MessageBox.d.ts +8 -0
- package/{buckaroo_js → dist/src}/components/OperationDetail.d.ts +4 -6
- package/dist/src/components/OperationExamples.d.ts +8 -0
- package/{buckaroo_js → dist/src}/components/OperationUtils.d.ts +1 -1
- package/dist/src/components/Operations.d.ts +14 -0
- package/dist/src/components/Operations.test.d.ts +4 -0
- package/dist/src/components/OperationsList.d.ts +9 -0
- package/dist/src/components/OperationsList.test.d.ts +0 -0
- package/dist/src/components/StatusBar.d.ts +15 -0
- package/{buckaroo_js → dist/src}/components/WidgetTypes.d.ts +3 -4
- package/dist/src/components/useColorScheme.d.ts +7 -0
- package/dist/src/components/utils.d.ts +299 -0
- package/dist/src/index.d.ts +59 -0
- package/dist/src/stories/BuckarooWidgetTest.stories.d.ts +12 -0
- package/dist/src/stories/ChartCell.stories.d.ts +20 -0
- package/dist/src/stories/ColumnsEditor.stories.d.ts +17 -0
- package/dist/src/stories/DFViewer.stories.d.ts +26 -0
- package/dist/src/stories/DFViewerInfiniteRaw.stories.d.ts +24 -0
- package/dist/src/stories/DFViewerInfiniteShadow.stories.d.ts +31 -0
- package/dist/src/stories/HistogramCell.stories.d.ts +18 -0
- package/dist/src/stories/InheritEdgeCases.stories.d.ts +12 -0
- package/dist/src/stories/InheritPinnedRows.stories.d.ts +13 -0
- package/dist/src/stories/MessageBox.stories.d.ts +26 -0
- package/dist/src/stories/OperationViewer.stories.d.ts +24 -0
- package/dist/src/stories/OperationsList.stories.d.ts +19 -0
- package/dist/src/stories/OutsideParamsInconsistency.stories.d.ts +16 -0
- package/dist/src/stories/PinnedRowsDynamic.stories.d.ts +12 -0
- package/dist/src/stories/PinnedRowsRace.stories.d.ts +12 -0
- package/dist/src/stories/PinnedRowsTranscriptReplayer.stories.d.ts +13 -0
- package/dist/src/stories/RawAGGrid.stories.d.ts +17 -0
- package/dist/src/stories/SmallDFScroll.stories.d.ts +11 -0
- package/dist/src/stories/StatusBar.stories.d.ts +19 -0
- package/dist/src/stories/StoryUtils.d.ts +13 -0
- package/dist/src/stories/Styling.stories.d.ts +15 -0
- package/dist/src/stories/StylingIssues.stories.d.ts +54 -0
- package/dist/src/stories/ThemeCustomization.stories.d.ts +22 -0
- package/dist/src/stories/UseMemoExamples.stories.d.ts +12 -0
- package/dist/src/stories/WeirdTypes.stories.d.ts +17 -0
- package/dist/src/test-utils/agGridSpy.d.ts +50 -0
- package/dist/src/widgetUtils.d.ts +1 -0
- package/dist/style.css +1 -0
- package/package.json +109 -101
- package/.prettierrc +0 -16
- package/CHANGELOG.md +0 -23
- package/buckaroo_js/baked_data/colorMap.d.ts.map +0 -1
- package/buckaroo_js/baked_data/colorMap.js +0 -520
- package/buckaroo_js/baked_data/colorMap.js.map +0 -1
- package/buckaroo_js/baked_data/staticData.d.ts +0 -124
- package/buckaroo_js/baked_data/staticData.d.ts.map +0 -1
- package/buckaroo_js/baked_data/staticData.js +0 -459
- package/buckaroo_js/baked_data/staticData.js.map +0 -1
- package/buckaroo_js/components/ColumnsEditor.d.ts.map +0 -1
- package/buckaroo_js/components/ColumnsEditor.js +0 -68
- package/buckaroo_js/components/ColumnsEditor.js.map +0 -1
- package/buckaroo_js/components/CommandUtils.d.ts.map +0 -1
- package/buckaroo_js/components/CommandUtils.js +0 -17
- package/buckaroo_js/components/CommandUtils.js.map +0 -1
- package/buckaroo_js/components/DCFCell.d.ts +0 -28
- package/buckaroo_js/components/DCFCell.d.ts.map +0 -1
- package/buckaroo_js/components/DCFCell.js +0 -120
- package/buckaroo_js/components/DCFCell.js.map +0 -1
- package/buckaroo_js/components/DFViewerParts/DFViewer.d.ts +0 -29
- package/buckaroo_js/components/DFViewerParts/DFViewer.d.ts.map +0 -1
- package/buckaroo_js/components/DFViewerParts/DFViewer.js +0 -163
- package/buckaroo_js/components/DFViewerParts/DFViewer.js.map +0 -1
- package/buckaroo_js/components/DFViewerParts/DFWhole.d.ts +0 -111
- package/buckaroo_js/components/DFViewerParts/DFWhole.d.ts.map +0 -1
- package/buckaroo_js/components/DFViewerParts/DFWhole.js +0 -17
- package/buckaroo_js/components/DFViewerParts/DFWhole.js.map +0 -1
- package/buckaroo_js/components/DFViewerParts/Displayer.d.ts.map +0 -1
- package/buckaroo_js/components/DFViewerParts/Displayer.js +0 -221
- package/buckaroo_js/components/DFViewerParts/Displayer.js.map +0 -1
- package/buckaroo_js/components/DFViewerParts/HistogramCell.d.ts +0 -20
- package/buckaroo_js/components/DFViewerParts/HistogramCell.d.ts.map +0 -1
- package/buckaroo_js/components/DFViewerParts/HistogramCell.js +0 -184
- package/buckaroo_js/components/DFViewerParts/HistogramCell.js.map +0 -1
- package/buckaroo_js/components/DFViewerParts/SeriesSummaryTooltip.d.ts +0 -5
- package/buckaroo_js/components/DFViewerParts/SeriesSummaryTooltip.d.ts.map +0 -1
- package/buckaroo_js/components/DFViewerParts/SeriesSummaryTooltip.js +0 -18
- package/buckaroo_js/components/DFViewerParts/SeriesSummaryTooltip.js.map +0 -1
- package/buckaroo_js/components/DFViewerParts/gridUtils.d.ts +0 -24
- package/buckaroo_js/components/DFViewerParts/gridUtils.d.ts.map +0 -1
- package/buckaroo_js/components/DFViewerParts/gridUtils.js +0 -230
- package/buckaroo_js/components/DFViewerParts/gridUtils.js.map +0 -1
- package/buckaroo_js/components/DependentTabs.d.ts.map +0 -1
- package/buckaroo_js/components/DependentTabs.js +0 -108
- package/buckaroo_js/components/DependentTabs.js.map +0 -1
- package/buckaroo_js/components/OperationDetail.d.ts.map +0 -1
- package/buckaroo_js/components/OperationDetail.js +0 -144
- package/buckaroo_js/components/OperationDetail.js.map +0 -1
- package/buckaroo_js/components/OperationUtils.d.ts.map +0 -1
- package/buckaroo_js/components/OperationUtils.js +0 -14
- package/buckaroo_js/components/OperationUtils.js.map +0 -1
- package/buckaroo_js/components/Operations.d.ts +0 -24
- package/buckaroo_js/components/Operations.d.ts.map +0 -1
- package/buckaroo_js/components/Operations.js +0 -209
- package/buckaroo_js/components/Operations.js.map +0 -1
- package/buckaroo_js/components/StatusBar.d.ts +0 -12
- package/buckaroo_js/components/StatusBar.d.ts.map +0 -1
- package/buckaroo_js/components/StatusBar.js +0 -155
- package/buckaroo_js/components/StatusBar.js.map +0 -1
- package/buckaroo_js/components/WidgetTypes.d.ts.map +0 -1
- package/buckaroo_js/components/WidgetTypes.js +0 -3
- package/buckaroo_js/components/WidgetTypes.js.map +0 -1
- package/buckaroo_js/components/bakedOperationDefaults.d.ts +0 -5
- package/buckaroo_js/components/bakedOperationDefaults.d.ts.map +0 -1
- package/buckaroo_js/components/bakedOperationDefaults.js +0 -15
- package/buckaroo_js/components/bakedOperationDefaults.js.map +0 -1
- package/buckaroo_js/components/utils.d.ts +0 -294
- package/buckaroo_js/components/utils.d.ts.map +0 -1
- package/buckaroo_js/components/utils.js +0 -143
- package/buckaroo_js/components/utils.js.map +0 -1
- package/buckaroo_js/extension.d.ts +0 -2
- package/buckaroo_js/extension.d.ts.map +0 -1
- package/buckaroo_js/extension.js +0 -20
- package/buckaroo_js/extension.js.map +0 -1
- package/buckaroo_js/index.d.ts +0 -25
- package/buckaroo_js/index.d.ts.map +0 -1
- package/buckaroo_js/index.js +0 -46
- package/buckaroo_js/index.js.map +0 -1
- package/buckaroo_js/vendor/RechartExtra.d.ts +0 -38
- package/buckaroo_js/vendor/RechartExtra.d.ts.map +0 -1
- package/buckaroo_js/vendor/RechartExtra.js +0 -17
- package/buckaroo_js/vendor/RechartExtra.js.map +0 -1
- package/buckaroo_js/vendor/RechartTooltip.d.ts +0 -82
- package/buckaroo_js/vendor/RechartTooltip.d.ts.map +0 -1
- package/buckaroo_js/vendor/RechartTooltip.js +0 -231
- package/buckaroo_js/vendor/RechartTooltip.js.map +0 -1
- package/codecov.yml +0 -16
- package/eslint.config.mjs +0 -88
- package/examples/App.tsx +0 -160
- package/examples/CodeBlock.tsx +0 -27
- package/examples/CodePenButton.tsx +0 -72
- package/examples/ReadmeBlock.tsx +0 -11
- package/examples/app.css +0 -29
- package/examples/ex/ColumnsEditorEx.tsx +0 -5
- package/examples/ex/CommandViewerEx.tsx +0 -18
- package/examples/ex/DFViewerEx.tsx +0 -3
- package/examples/ex/DFViewerEx_large.tsx +0 -266
- package/examples/ex/DFViewerEx_real_summary.tsx +0 -18
- package/examples/ex/DFViewerEx_short_data.tsx +0 -22
- package/examples/ex/DFViewerEx_string_index.tsx +0 -1012
- package/examples/ex/HistogramEx.tsx +0 -66
- package/examples/ex/StatusBarEx.tsx +0 -46
- package/examples/ex/WidgetDCFCellEx.tsx +0 -6
- package/examples/example.css +0 -20
- package/examples/index-iframe.hnottml +0 -24
- package/examples/index-react18.tsx +0 -8
- package/examples/index.html +0 -20
- package/examples/jsx-loader.ts +0 -16
- package/examples/tsconfig.json +0 -31
- package/index.d.ts +0 -2
- package/index.d.ts.map +0 -1
- package/index.js +0 -7
- package/index.js.map +0 -1
- package/jest.config.js +0 -24
- package/screen-animation.gif +0 -0
- package/src/buckaroo_js/baked_data/colorMap.ts +0 -523
- package/src/buckaroo_js/baked_data/staticData.ts +0 -503
- package/src/buckaroo_js/components/ColumnsEditor.tsx +0 -66
- package/src/buckaroo_js/components/CommandUtils.ts +0 -40
- package/src/buckaroo_js/components/DCFCell.tsx +0 -175
- package/src/buckaroo_js/components/DFViewerParts/DFViewer.tsx +0 -215
- package/src/buckaroo_js/components/DFViewerParts/DFWhole.ts +0 -190
- package/src/buckaroo_js/components/DFViewerParts/Displayer.ts +0 -215
- package/src/buckaroo_js/components/DFViewerParts/HistogramCell.tsx +0 -251
- package/src/buckaroo_js/components/DFViewerParts/SeriesSummaryTooltip.tsx +0 -20
- package/src/buckaroo_js/components/DFViewerParts/gridUtils.ts +0 -290
- package/src/buckaroo_js/components/DependentTabs.tsx +0 -134
- package/src/buckaroo_js/components/OperationDetail.tsx +0 -203
- package/src/buckaroo_js/components/OperationUtils.ts +0 -33
- package/src/buckaroo_js/components/Operations.tsx +0 -243
- package/src/buckaroo_js/components/StatusBar.tsx +0 -190
- package/src/buckaroo_js/components/WidgetTypes.tsx +0 -42
- package/src/buckaroo_js/components/bakedOperationDefaults.ts +0 -14
- package/src/buckaroo_js/components/utils.ts +0 -60
- package/src/buckaroo_js/extension.ts +0 -15
- package/src/buckaroo_js/index.ts +0 -34
- package/src/buckaroo_js/style/dcf-npm.css +0 -244
- package/src/buckaroo_js/style/icons/arrow-down-short-dark.svg +0 -4
- package/src/buckaroo_js/style/icons/arrow-down-short.svg +0 -4
- package/src/buckaroo_js/style/icons/arrow-up-short-dark.svg +0 -4
- package/src/buckaroo_js/style/icons/arrow-up-short.svg +0 -4
- package/src/buckaroo_js/style/icons/filter-dark.svg +0 -3
- package/src/buckaroo_js/style/icons/filter.svg +0 -3
- package/src/buckaroo_js/vendor/RechartExtra.ts +0 -60
- package/src/buckaroo_js/vendor/RechartTooltip.tsx +0 -356
- package/src/index.tsx +0 -3
- package/tsconfig.json +0 -41
- package/webpack.config.ts +0 -98
|
@@ -1,503 +0,0 @@
|
|
|
1
|
-
import {OperationDefaultArgs, Operation} from '../components/OperationUtils';
|
|
2
|
-
import {sym} from '../components/utils';
|
|
3
|
-
import {symDf, CommandConfigT, bakedArgSpecs} from '../components/CommandUtils';
|
|
4
|
-
import {DFData, DFViewerConfig, DFWhole} from '../components/DFViewerParts/DFWhole';
|
|
5
|
-
|
|
6
|
-
export const bakedOperationDefaults: OperationDefaultArgs = {
|
|
7
|
-
dropcol: [sym('dropcol'), symDf, 'col'],
|
|
8
|
-
fillna: [sym('fillna'), symDf, 'col', 8],
|
|
9
|
-
remove_outliers: [sym('remove_outliers'), symDf, 'col', 0.02],
|
|
10
|
-
search: [sym('search'), symDf, 'col', 'term'],
|
|
11
|
-
resample: [sym('resample'), symDf, 'col', 'monthly', {}]
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const bakedCommandConfig: CommandConfigT = {
|
|
15
|
-
argspecs: bakedArgSpecs,
|
|
16
|
-
defaultArgs: bakedOperationDefaults
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const bakedOperations: Operation[] = [
|
|
20
|
-
[sym('dropcol'), symDf, 'col1'],
|
|
21
|
-
[sym('fillna'), symDf, 'col2', 5],
|
|
22
|
-
[sym('resample'), symDf, 'month', 'monthly', {}]
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
export const histograms = {
|
|
26
|
-
num_histo: [
|
|
27
|
-
{name: '-406 - -332', population: 1},
|
|
28
|
-
{name: '-332 - -258', population: 0},
|
|
29
|
-
{name: '-258 - -184', population: 2},
|
|
30
|
-
{name: '-184 - -111', population: 10},
|
|
31
|
-
{name: '-111 - -37', population: 22},
|
|
32
|
-
{name: '-37 - 36', population: 30},
|
|
33
|
-
{name: '36 - 109', population: 22},
|
|
34
|
-
{name: '109 - 183', population: 10},
|
|
35
|
-
{name: '183 - 257', population: 3},
|
|
36
|
-
{name: '257 - 331', population: 0}
|
|
37
|
-
],
|
|
38
|
-
|
|
39
|
-
bool_histo: [
|
|
40
|
-
{name: 'False', false: 50},
|
|
41
|
-
{name: 'True', true: 30},
|
|
42
|
-
{name: 'NA', NA: 20}
|
|
43
|
-
],
|
|
44
|
-
|
|
45
|
-
NA_Only: [{name: 'NA', NA: 100}],
|
|
46
|
-
|
|
47
|
-
simple_catgeorical: [
|
|
48
|
-
{name: 2, cat_pop: 87.0},
|
|
49
|
-
{name: 1, cat_pop: 13.0}
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
categorical_histo: [
|
|
53
|
-
{name: 'KTM', cat_pop: 30},
|
|
54
|
-
{name: 'Gas Gas', cat_pop: 15},
|
|
55
|
-
{name: 'Yamaha', cat_pop: 10},
|
|
56
|
-
{name: 'unique', unique: 25},
|
|
57
|
-
{name: 'NA', NA: 20}
|
|
58
|
-
],
|
|
59
|
-
|
|
60
|
-
categorical_histo_lt: [
|
|
61
|
-
{name: 'KTM', cat_pop: 25},
|
|
62
|
-
{name: 'Gas Gas', cat_pop: 12},
|
|
63
|
-
{name: 'Yamaha', cat_pop: 8},
|
|
64
|
-
{name: 'NA', NA: 20},
|
|
65
|
-
{name: 'longtail', unique: 15, longtail: 20}
|
|
66
|
-
],
|
|
67
|
-
|
|
68
|
-
all_unique: [{name: 'unique', unique: 100}],
|
|
69
|
-
|
|
70
|
-
unique_na: [
|
|
71
|
-
{name: 'unique', unique: 80},
|
|
72
|
-
{name: 'NA', NA: 20}
|
|
73
|
-
],
|
|
74
|
-
|
|
75
|
-
unique_continuous: [
|
|
76
|
-
{name: '-406 -332', population: 1},
|
|
77
|
-
{name: '-332 -258', population: 0},
|
|
78
|
-
{name: '-258 -184', population: 0},
|
|
79
|
-
{name: '-184 -111', population: 10},
|
|
80
|
-
{name: '-111 -37', population: 21},
|
|
81
|
-
{name: '-37 36', population: 29},
|
|
82
|
-
{name: '36 109', population: 22},
|
|
83
|
-
{name: '109 183', population: 9},
|
|
84
|
-
{name: '183 257', population: 3},
|
|
85
|
-
{name: '257 331', population: 0},
|
|
86
|
-
{name: 'unique', unique: 100}
|
|
87
|
-
],
|
|
88
|
-
|
|
89
|
-
unique_continuous_scaled: [
|
|
90
|
-
{name: '-406 -332', population: 0},
|
|
91
|
-
{name: '-332 -258', population: 0},
|
|
92
|
-
{name: '-258 -184', population: 0},
|
|
93
|
-
{name: '-184 -111', population: 10},
|
|
94
|
-
{name: '-111 -37', population: 21},
|
|
95
|
-
{name: '-37 36', population: 29},
|
|
96
|
-
{name: '36 109', population: 22},
|
|
97
|
-
{name: '109 183', population: 9},
|
|
98
|
-
{name: '183 257', population: 3},
|
|
99
|
-
{name: '257 331', population: 0},
|
|
100
|
-
{name: 'unique', unique: 29}
|
|
101
|
-
],
|
|
102
|
-
|
|
103
|
-
unique_continuous_scaled_50: [
|
|
104
|
-
{name: '-406 -332', population: 0},
|
|
105
|
-
{name: '-332 -258', population: 0},
|
|
106
|
-
{name: '-258 -184', population: 0},
|
|
107
|
-
{name: '-184 -111', population: 10},
|
|
108
|
-
{name: '-111 -37', population: 21},
|
|
109
|
-
{name: '-37 36', population: 29},
|
|
110
|
-
{name: '36 109', population: 22},
|
|
111
|
-
{name: '109 183', population: 9},
|
|
112
|
-
{name: '183 257', population: 3},
|
|
113
|
-
{name: '257 331', population: 0},
|
|
114
|
-
{name: 'longtail', unique: 15}
|
|
115
|
-
],
|
|
116
|
-
start_station_categorical: [
|
|
117
|
-
{name: 'Pershing Square N', cat_pop: 1},
|
|
118
|
-
{name: '8 Ave & W 31 St', cat_pop: 1},
|
|
119
|
-
{name: 'Lafayette St & E 8 St', cat_pop: 1},
|
|
120
|
-
{name: 'W 21 St & 6 Ave', cat_pop: 1},
|
|
121
|
-
{name: 'E 17 St & Broadway', cat_pop: 1},
|
|
122
|
-
{name: '8 Ave & W 33 St', cat_pop: 1},
|
|
123
|
-
{name: 'E 43 St & Vanderbilt Ave', cat_pop: 1},
|
|
124
|
-
{name: 'unique', cat_pop: 0},
|
|
125
|
-
{name: 'long_tail', cat_pop: 92},
|
|
126
|
-
{name: 'NA', cat_pop: 0}
|
|
127
|
-
]
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const smileyPNGString =
|
|
131
|
-
'iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=';
|
|
132
|
-
|
|
133
|
-
//export const tableDf2:DFWhole = {
|
|
134
|
-
export const foo: DFWhole = {
|
|
135
|
-
dfviewer_config: {
|
|
136
|
-
column_config: [
|
|
137
|
-
{col_name: 'index', displayer_args: {displayer: 'obj'}},
|
|
138
|
-
|
|
139
|
-
{col_name: 'tripduration', displayer_args: {displayer: 'obj'}},
|
|
140
|
-
{col_name: 'starttime', displayer_args: {displayer: 'obj'}},
|
|
141
|
-
{col_name: 'stoptime', displayer_args: {displayer: 'obj'}},
|
|
142
|
-
{col_name: 'start station id', displayer_args: {displayer: 'obj'}},
|
|
143
|
-
{col_name: 'start station name', displayer_args: {displayer: 'obj'}},
|
|
144
|
-
{
|
|
145
|
-
col_name: 'start station lattitude',
|
|
146
|
-
displayer_args: {displayer: 'obj'}
|
|
147
|
-
},
|
|
148
|
-
{col_name: 'bikeid', displayer_args: {displayer: 'obj'}},
|
|
149
|
-
{col_name: 'birth year', displayer_args: {displayer: 'obj'}},
|
|
150
|
-
{col_name: 'gender', displayer_args: {displayer: 'obj'}}
|
|
151
|
-
],
|
|
152
|
-
pinned_rows: []
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
// index: { type: 'obj' },
|
|
156
|
-
// tripduration: { histogram: histograms.num_histo, type: 'obj' },
|
|
157
|
-
/*
|
|
158
|
-
starttime: { type: 'obj' },
|
|
159
|
-
stoptime: { type: 'obj' },
|
|
160
|
-
'start station id': { type: 'obj' },
|
|
161
|
-
'start station name': { type: 'obj' },
|
|
162
|
-
'start station latitude': { type: 'obj' },
|
|
163
|
-
bikeid: { type: 'obj' },
|
|
164
|
-
'birth year': { type: 'obj' },
|
|
165
|
-
gender: { type: 'obj' },
|
|
166
|
-
*/
|
|
167
|
-
data: [
|
|
168
|
-
{
|
|
169
|
-
index: 0,
|
|
170
|
-
tripduration: 404,
|
|
171
|
-
starttime: '2014-07-01 00:00:04',
|
|
172
|
-
stoptime: '2014-07-01 00:06:48',
|
|
173
|
-
'start station id': 545,
|
|
174
|
-
'start station name': 'E 23 St & 1 Ave',
|
|
175
|
-
'start station latitude': 40.736502,
|
|
176
|
-
bikeid: 19578,
|
|
177
|
-
'birth year': '1987',
|
|
178
|
-
gender: 2,
|
|
179
|
-
img_: smileyPNGString
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
index: 1,
|
|
183
|
-
tripduration: 850,
|
|
184
|
-
starttime: '2014-07-01 00:00:06',
|
|
185
|
-
stoptime: '2014-07-01 00:14:16',
|
|
186
|
-
'start station id': 238,
|
|
187
|
-
'start station name': 'Bank St & Washington St',
|
|
188
|
-
'start station latitude': 40.7361967,
|
|
189
|
-
bikeid: 19224,
|
|
190
|
-
'birth year': '1987',
|
|
191
|
-
gender: 1
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
index: 2,
|
|
195
|
-
tripduration: 1550,
|
|
196
|
-
starttime: '2014-07-01 00:00:21',
|
|
197
|
-
stoptime: '2014-07-01 00:26:11',
|
|
198
|
-
'start station id': 223,
|
|
199
|
-
'start station name': 'W 13 St & 7 Ave',
|
|
200
|
-
'start station latitude': 40.73781509,
|
|
201
|
-
bikeid: 17627,
|
|
202
|
-
'birth year': '1973',
|
|
203
|
-
gender: 2
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
index: 3,
|
|
207
|
-
tripduration: 397,
|
|
208
|
-
starttime: '2014-07-01 00:00:29',
|
|
209
|
-
stoptime: '2014-07-01 00:07:06',
|
|
210
|
-
'start station id': 224,
|
|
211
|
-
'start station name': 'Spruce St & Nassau St',
|
|
212
|
-
'start station latitude': 40.71146364,
|
|
213
|
-
bikeid: 15304,
|
|
214
|
-
'birth year': '1982',
|
|
215
|
-
gender: 1
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
index: 4,
|
|
219
|
-
tripduration: 609,
|
|
220
|
-
starttime: '2014-07-01 00:00:37',
|
|
221
|
-
stoptime: '2014-07-01 00:10:46',
|
|
222
|
-
'start station id': 346,
|
|
223
|
-
'start station name': 'Bank St & Hudson St',
|
|
224
|
-
'start station latitude': 40.73652889,
|
|
225
|
-
bikeid: 20062,
|
|
226
|
-
'birth year': '1972',
|
|
227
|
-
gender: 2
|
|
228
|
-
}
|
|
229
|
-
]
|
|
230
|
-
};
|
|
231
|
-
export const stringIndexDf = foo;
|
|
232
|
-
|
|
233
|
-
export const tableDf: DFWhole = {
|
|
234
|
-
dfviewer_config: {
|
|
235
|
-
column_config: [
|
|
236
|
-
{
|
|
237
|
-
col_name: 'index',
|
|
238
|
-
displayer_args: {displayer: 'integer', min_digits: 3, max_digits: 5}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
col_name: 'svg_column',
|
|
242
|
-
displayer_args: {displayer: 'SVGDisplayer'}
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
col_name: 'link_column',
|
|
246
|
-
displayer_args: {displayer: 'linkify'}
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
col_name: 'nanObject',
|
|
250
|
-
displayer_args: {displayer: 'integer', min_digits: 3, max_digits: 5},
|
|
251
|
-
color_map_config: {
|
|
252
|
-
color_rule: 'color_map',
|
|
253
|
-
//map_name: 'DIVERGING_RED_WHITE_BLUE',
|
|
254
|
-
map_name: 'BLUE_TO_YELLOW',
|
|
255
|
-
val_column: 'tripduration'
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
col_name: 'nanFloat',
|
|
260
|
-
displayer_args: {
|
|
261
|
-
displayer: 'float',
|
|
262
|
-
min_fraction_digits: 2,
|
|
263
|
-
max_fraction_digits: 8
|
|
264
|
-
},
|
|
265
|
-
tooltip_config: {tooltip_type: 'summary_series'}
|
|
266
|
-
},
|
|
267
|
-
{col_name: 'end station name', displayer_args: {displayer: 'obj'}},
|
|
268
|
-
{
|
|
269
|
-
col_name: 'tripduration',
|
|
270
|
-
displayer_args: {displayer: 'integer', min_digits: 1, max_digits: 5},
|
|
271
|
-
color_map_config: {
|
|
272
|
-
color_rule: 'color_map',
|
|
273
|
-
map_name: 'BLUE_TO_YELLOW'
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
col_name: 'start station name',
|
|
278
|
-
displayer_args: {displayer: 'obj'},
|
|
279
|
-
color_map_config: {
|
|
280
|
-
color_rule: 'color_not_null',
|
|
281
|
-
conditional_color: 'red',
|
|
282
|
-
exist_column: 'nanFloat'
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
col_name: 'floatCol',
|
|
287
|
-
displayer_args: {
|
|
288
|
-
displayer: 'float',
|
|
289
|
-
min_fraction_digits: 1,
|
|
290
|
-
max_fraction_digits: 3
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
col_name: 'nanNumeric',
|
|
295
|
-
displayer_args: {displayer: 'integer', min_digits: 3, max_digits: 5},
|
|
296
|
-
tooltip_config: {
|
|
297
|
-
tooltip_type: 'simple',
|
|
298
|
-
val_column: 'start station name'
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
col_name: 'img_',
|
|
303
|
-
displayer_args: {displayer: 'Base64PNGImageDisplayer'},
|
|
304
|
-
ag_grid_specs: {width: 150}
|
|
305
|
-
}
|
|
306
|
-
],
|
|
307
|
-
extra_grid_config: {rowHeight: 105},
|
|
308
|
-
component_config: {height_fraction: 1},
|
|
309
|
-
pinned_rows: [
|
|
310
|
-
// { primary_key_val: 'dtype', displayer_args: { displayer: 'obj' } },
|
|
311
|
-
// { primary_key_val: 'histogram', displayer_args: { displayer: 'histogram' }, },
|
|
312
|
-
]
|
|
313
|
-
},
|
|
314
|
-
data: [
|
|
315
|
-
{
|
|
316
|
-
index: 0,
|
|
317
|
-
'end station name': 'Elizabeth St & Hester St',
|
|
318
|
-
tripduration: 471,
|
|
319
|
-
'start station name': 'Catherine St & Monroe St',
|
|
320
|
-
floatCol: '1.111',
|
|
321
|
-
nanNumeric: null,
|
|
322
|
-
nanObject: null,
|
|
323
|
-
nanFloat: null,
|
|
324
|
-
//svg_column: '<h1> paddy </h1>',
|
|
325
|
-
link_column: 'https://buckaroo.dev',
|
|
326
|
-
img_: smileyPNGString
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
index: 1,
|
|
330
|
-
'end station name': 'South St & Whitehall St',
|
|
331
|
-
tripduration: 1494,
|
|
332
|
-
'start station name': '1 Ave & E 30 St',
|
|
333
|
-
floatCol: '8.888',
|
|
334
|
-
nanNumeric: null,
|
|
335
|
-
nanObject: null,
|
|
336
|
-
nanFloat: null,
|
|
337
|
-
svg_column:
|
|
338
|
-
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" viewBox="43.4952 4.7852 4.449600000000004 3.3796" preserveAspectRatio="xMinYMin meet"><g transform="matrix(1,0,0,-1,0,12.95)"><path fill-rule="evenodd" fill="#66cc99" stroke="#555555" stroke-width="0.08899200000000007" opacity="0.6" d="M 47.78,8.0 L 44.96,5.0 L 43.66,4.95 L 46.94,7.99 L 47.78,8.0 z" /></g></svg>',
|
|
339
|
-
link_column: 'https://pola.rs/'
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
index: 2,
|
|
343
|
-
'end station name': 'E 59 St & Sutton Pl',
|
|
344
|
-
tripduration: 464,
|
|
345
|
-
'start station name': 'E 48 St & 3 Ave',
|
|
346
|
-
floatCol: '9.999',
|
|
347
|
-
nanNumeric: null,
|
|
348
|
-
nanObject: null,
|
|
349
|
-
svg_column:
|
|
350
|
-
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100.0" height="100.0" viewBox="29.0828 3.4328 1.8143999999999991 1.2343999999999995" preserveAspectRatio="xMinYMin meet"><g transform="matrix(1,0,0,-1,0,8.1)"><path fill-rule="evenodd" fill="#66cc99" stroke="#555555" stroke-width="0.03628799999999998" opacity="0.6" d="M 30.83,3.5 L 29.95,4.17 L 29.71,4.6 L 29.15,4.38 L 30.83,3.5 z" /></g></svg>',
|
|
351
|
-
nanFloat: 10
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
index: 3,
|
|
355
|
-
'end station name': 'E 33 St & 5 Ave',
|
|
356
|
-
tripduration: 373,
|
|
357
|
-
'start station name': 'Pershing Square N',
|
|
358
|
-
floatCol: '-10.1',
|
|
359
|
-
nanCol: null,
|
|
360
|
-
nanNumeric: null,
|
|
361
|
-
nanObject: null,
|
|
362
|
-
svg_column:
|
|
363
|
-
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100.0" height="100.0" viewBox="40.693599999999996 -1.9163999999999999 1.6728000000000094 6.3828" preserveAspectRatio="xMinYMin meet"><g transform="matrix(1,0,0,-1,0,2.5500000000000003)"><path fill-rule="evenodd" fill="#66cc99" stroke="#555555" stroke-width="0.127656" opacity="0.6" d="M 41.58,-1.68 L 40.93,-0.85 L 40.95,2.78 L 41.85,3.91 L 42.13,4.23 L 41.58,-1.68 z" /></g></svg>',
|
|
364
|
-
nanFloat: null
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
index: 4,
|
|
368
|
-
'end station name': 'Hancock St & Bedford Ave',
|
|
369
|
-
tripduration: 660,
|
|
370
|
-
'start station name': 'Atlantic Ave & Fort Greene Pl',
|
|
371
|
-
floatCol: '10.99',
|
|
372
|
-
nanNumeric: null,
|
|
373
|
-
nanObject: null,
|
|
374
|
-
nanFloat: 3
|
|
375
|
-
}
|
|
376
|
-
]
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
export const dfviewer_config_no_pinned: DFViewerConfig = {
|
|
380
|
-
column_config: tableDf.dfviewer_config.column_config,
|
|
381
|
-
pinned_rows: [
|
|
382
|
-
{primary_key_val: 'dtype', displayer_args: {displayer: 'obj'}},
|
|
383
|
-
{
|
|
384
|
-
primary_key_val: 'histogram',
|
|
385
|
-
displayer_args: {displayer: 'histogram'}
|
|
386
|
-
}
|
|
387
|
-
]
|
|
388
|
-
};
|
|
389
|
-
const tripDurationBins = [0, 300, 500, 1000, 1500];
|
|
390
|
-
|
|
391
|
-
export const summaryDfForTableDf: DFData = [
|
|
392
|
-
{
|
|
393
|
-
index: 'histogram',
|
|
394
|
-
'end station name': histograms.categorical_histo_lt,
|
|
395
|
-
tripduration: histograms.num_histo,
|
|
396
|
-
'start station name': histograms.bool_histo,
|
|
397
|
-
nanNumeric: histograms.num_histo,
|
|
398
|
-
nanFloat: histograms.num_histo,
|
|
399
|
-
nanObject: histograms.num_histo,
|
|
400
|
-
floatCol: [
|
|
401
|
-
{name: 521, cat_pop: 0.0103},
|
|
402
|
-
{name: 358, cat_pop: 0.0096},
|
|
403
|
-
{name: 519, cat_pop: 0.009},
|
|
404
|
-
{name: 497, cat_pop: 0.0087},
|
|
405
|
-
{name: 293, cat_pop: 0.0082},
|
|
406
|
-
{name: 285, cat_pop: 0.0081},
|
|
407
|
-
{name: 435, cat_pop: 0.008},
|
|
408
|
-
{name: 'unique', cat_pop: 0.0001},
|
|
409
|
-
{name: 'long_tail', cat_pop: 0.938},
|
|
410
|
-
{name: 'NA', cat_pop: 0.0}
|
|
411
|
-
]
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
index: 'histogram_bins',
|
|
415
|
-
tripduration: tripDurationBins,
|
|
416
|
-
nanObject: tripDurationBins
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
index: 'dtype',
|
|
420
|
-
'end station name': 'String6666',
|
|
421
|
-
tripduration: 'object',
|
|
422
|
-
'start station name': 'object',
|
|
423
|
-
nanNumeric: 'float64',
|
|
424
|
-
nanFloat: 'flot64',
|
|
425
|
-
nanObject: 'object',
|
|
426
|
-
floatCol: 'float'
|
|
427
|
-
}
|
|
428
|
-
];
|
|
429
|
-
|
|
430
|
-
export const realSummaryTableData: DFData = [
|
|
431
|
-
{index: 'dtype', int_col: 'int64', float_col: 'float64', str_col: 'object'},
|
|
432
|
-
{index: 'min', int_col: 1, float_col: 1.4285714286},
|
|
433
|
-
{index: 'max', int_col: 49, float_col: 41.4285714286, str_col: null},
|
|
434
|
-
{index: 'mean', int_col: 24.75, float_col: 22.4714285714},
|
|
435
|
-
{index: 'unique_count', int_col: 4, float_col: 0, str_col: 0},
|
|
436
|
-
{index: 'empty_count', int_col: 0, float_col: 0, str_col: 0},
|
|
437
|
-
{index: 'distinct_count', int_col: 49, float_col: 29, str_col: 1}
|
|
438
|
-
];
|
|
439
|
-
|
|
440
|
-
export const realSummaryConfig: DFViewerConfig = {
|
|
441
|
-
pinned_rows: [
|
|
442
|
-
{primary_key_val: 'dtype', displayer_args: {displayer: 'obj'}},
|
|
443
|
-
{
|
|
444
|
-
primary_key_val: 'min',
|
|
445
|
-
displayer_args: {
|
|
446
|
-
displayer: 'float',
|
|
447
|
-
min_fraction_digits: 3,
|
|
448
|
-
max_fraction_digits: 3
|
|
449
|
-
}
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
primary_key_val: 'mean',
|
|
453
|
-
displayer_args: {
|
|
454
|
-
displayer: 'float',
|
|
455
|
-
min_fraction_digits: 3,
|
|
456
|
-
max_fraction_digits: 3
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
primary_key_val: 'max',
|
|
461
|
-
displayer_args: {
|
|
462
|
-
displayer: 'float',
|
|
463
|
-
min_fraction_digits: 3,
|
|
464
|
-
max_fraction_digits: 3
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
primary_key_val: 'unique_count',
|
|
469
|
-
displayer_args: {
|
|
470
|
-
displayer: 'float',
|
|
471
|
-
min_fraction_digits: 0,
|
|
472
|
-
max_fraction_digits: 0
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
primary_key_val: 'distinct_count',
|
|
477
|
-
displayer_args: {
|
|
478
|
-
displayer: 'float',
|
|
479
|
-
min_fraction_digits: 0,
|
|
480
|
-
max_fraction_digits: 0
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
primary_key_val: 'empty_count',
|
|
485
|
-
displayer_args: {
|
|
486
|
-
displayer: 'float',
|
|
487
|
-
min_fraction_digits: 0,
|
|
488
|
-
max_fraction_digits: 0
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
],
|
|
492
|
-
column_config: [
|
|
493
|
-
// {'col_name': 'index', 'displayer_args': {'displayer': 'string'}},
|
|
494
|
-
{
|
|
495
|
-
col_name: 'index',
|
|
496
|
-
displayer_args: {displayer: 'string'},
|
|
497
|
-
ag_grid_specs: {minWidth: 150, pinned: 'left'}
|
|
498
|
-
},
|
|
499
|
-
{col_name: 'int_col', displayer_args: {displayer: 'obj'}},
|
|
500
|
-
{col_name: 'float_col', displayer_args: {displayer: 'obj'}},
|
|
501
|
-
{col_name: 'str_col', displayer_args: {displayer: 'obj'}}
|
|
502
|
-
]
|
|
503
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react';
|
|
2
|
-
import {bakedOperations} from '../baked_data/staticData';
|
|
3
|
-
import {DFViewerConfig, EmptyDf} from './DFViewerParts/DFWhole';
|
|
4
|
-
import {OperationViewer} from './Operations';
|
|
5
|
-
import {Operation} from './OperationUtils';
|
|
6
|
-
import {CommandConfigT} from './CommandUtils';
|
|
7
|
-
//import {bakedCommandConfig} from './bakedOperationDefaults';
|
|
8
|
-
import {DependentTabs, OperationResult} from './DependentTabs';
|
|
9
|
-
import {tableDf, bakedCommandConfig} from '../baked_data/staticData';
|
|
10
|
-
|
|
11
|
-
export type OperationSetter = (ops: Operation[]) => void;
|
|
12
|
-
export interface WidgetConfig {
|
|
13
|
-
showCommands: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function ColumnsEditor({
|
|
17
|
-
df_viewer_config,
|
|
18
|
-
activeColumn,
|
|
19
|
-
operations,
|
|
20
|
-
setOperations,
|
|
21
|
-
operationResult,
|
|
22
|
-
commandConfig
|
|
23
|
-
}: {
|
|
24
|
-
df_viewer_config: DFViewerConfig;
|
|
25
|
-
activeColumn: string;
|
|
26
|
-
operations: Operation[];
|
|
27
|
-
setOperations: OperationSetter;
|
|
28
|
-
operationResult: OperationResult;
|
|
29
|
-
commandConfig: CommandConfigT;
|
|
30
|
-
}) {
|
|
31
|
-
const allColumns = df_viewer_config.column_config.map((field) => field.col_name);
|
|
32
|
-
return (
|
|
33
|
-
<div className='columns-editor' style={{width: '100%'}}>
|
|
34
|
-
<div>
|
|
35
|
-
<OperationViewer
|
|
36
|
-
operations={operations}
|
|
37
|
-
setOperations={setOperations}
|
|
38
|
-
activeColumn={activeColumn}
|
|
39
|
-
allColumns={allColumns}
|
|
40
|
-
commandConfig={commandConfig}
|
|
41
|
-
/>
|
|
42
|
-
<DependentTabs filledOperations={operations} operationResult={operationResult} />
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function ColumnsEditorEx() {
|
|
49
|
-
const [operations, setOperations] = useState(bakedOperations);
|
|
50
|
-
|
|
51
|
-
const baseOperationResults: OperationResult = {
|
|
52
|
-
transformed_df: EmptyDf,
|
|
53
|
-
generated_py_code: 'default py code',
|
|
54
|
-
transform_error: undefined
|
|
55
|
-
};
|
|
56
|
-
return (
|
|
57
|
-
<ColumnsEditor
|
|
58
|
-
df_viewer_config={tableDf.dfviewer_config}
|
|
59
|
-
activeColumn={'foo'}
|
|
60
|
-
commandConfig={bakedCommandConfig}
|
|
61
|
-
operations={operations}
|
|
62
|
-
setOperations={setOperations}
|
|
63
|
-
operationResult={baseOperationResults}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {OperationDefaultArgs} from './OperationUtils';
|
|
2
|
-
|
|
3
|
-
export type TypeSpec = [number, string, 'type', 'integer' | 'float' | 'string'];
|
|
4
|
-
export type EnumSpec = [number, string, 'enum', string[]];
|
|
5
|
-
export type ColEnumSpec = [number, string, 'colEnum', string[]];
|
|
6
|
-
|
|
7
|
-
export type NoArgs = null;
|
|
8
|
-
export type ActualArg = TypeSpec | EnumSpec | ColEnumSpec;
|
|
9
|
-
export type ArgSpec = TypeSpec | EnumSpec | ColEnumSpec | NoArgs;
|
|
10
|
-
|
|
11
|
-
export interface SymbolT {
|
|
12
|
-
symbol: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface SymbolDf {
|
|
16
|
-
symbol: 'df';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const symDf: SymbolDf = {
|
|
20
|
-
symbol: 'df'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type ColEnumArgs = Record<string, string>;
|
|
24
|
-
|
|
25
|
-
export type CommandArgSpec = Record<string, ArgSpec[]>;
|
|
26
|
-
export const bakedArgSpecs: CommandArgSpec = {
|
|
27
|
-
dropcol: [null],
|
|
28
|
-
fillna: [[3, 'fillVal', 'type', 'integer']],
|
|
29
|
-
remove_outliers: [[3, 'tail', 'type', 'float']],
|
|
30
|
-
search: [[3, 'needle', 'type', 'string']],
|
|
31
|
-
resample: [
|
|
32
|
-
[3, 'frequency', 'enum', ['daily', 'weekly', 'monthly']],
|
|
33
|
-
[4, 'colMap', 'colEnum', ['null', 'sum', 'mean', 'count']]
|
|
34
|
-
]
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type CommandConfigT = {
|
|
38
|
-
argspecs: CommandArgSpec;
|
|
39
|
-
defaultArgs: OperationDefaultArgs;
|
|
40
|
-
};
|