buckaroo-js-core 0.8.4 → 0.8.5
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/buckaroo_js/components/DFViewerParts/Displayer.d.ts +1 -2
- package/buckaroo_js/components/DFViewerParts/Displayer.d.ts.map +1 -1
- package/buckaroo_js/components/DFViewerParts/Displayer.js +4 -5
- package/buckaroo_js/components/DFViewerParts/Displayer.js.map +1 -1
- package/buckaroo_js/components/DFViewerParts/OtherRenderers.d.ts +7 -0
- package/buckaroo_js/components/DFViewerParts/OtherRenderers.d.ts.map +1 -0
- package/buckaroo_js/components/DFViewerParts/OtherRenderers.js +29 -0
- package/buckaroo_js/components/DFViewerParts/OtherRenderers.js.map +1 -0
- package/buckaroo_js/components/DFViewerParts/gridUtils.d.ts.map +1 -1
- package/buckaroo_js/components/DFViewerParts/gridUtils.js +3 -3
- package/buckaroo_js/components/DFViewerParts/gridUtils.js.map +1 -1
- package/buckaroo_js/index.d.ts +0 -1
- package/buckaroo_js/index.d.ts.map +1 -1
- package/buckaroo_js/index.js +1 -3
- package/buckaroo_js/index.js.map +1 -1
- package/examples/ex/HistogramEx.tsx +40 -65
- package/package.json +2 -5
- package/src/buckaroo_js/components/DFViewerParts/Displayer.ts +8 -5
- package/src/buckaroo_js/components/DFViewerParts/OtherRenderers.tsx +28 -0
- package/src/buckaroo_js/components/DFViewerParts/gridUtils.ts +4 -3
- package/src/buckaroo_js/index.ts +3 -5
- package/src/buckaroo_js/components/DFViewerParts/HistogramCell.tsx +0 -251
- package/src/buckaroo_js/vendor/RechartExtra.ts +0 -60
- package/src/buckaroo_js/vendor/RechartTooltip.tsx +0 -356
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ValueFormatterFunc, ValueFormatterParams } from 'ag-grid-community';
|
|
3
2
|
import { DisplayerArgs, FloatDisplayerA, DatetimeLocaleDisplayerA, StringDisplayerA, ObjDisplayerA } from './DFWhole';
|
|
4
3
|
import { CellRendererArgs, FormatterArgs } from './DFWhole';
|
|
@@ -14,6 +13,6 @@ export declare const getFloatFormatter: (hint: FloatDisplayerA) => (params: Valu
|
|
|
14
13
|
export declare const getDatetimeFormatter: (colHint: DatetimeLocaleDisplayerA) => (params: ValueFormatterParams) => string;
|
|
15
14
|
export declare const defaultDatetimeFormatter: (params: ValueFormatterParams) => string;
|
|
16
15
|
export declare function getFormatter(fArgs: FormatterArgs): ValueFormatterFunc<unknown>;
|
|
17
|
-
export declare function getCellRenderer(crArgs: CellRendererArgs):
|
|
16
|
+
export declare function getCellRenderer(crArgs: CellRendererArgs): string;
|
|
18
17
|
export declare function getFormatterFromArgs(dispArgs: DisplayerArgs): ValueFormatterFunc<unknown, any> | undefined;
|
|
19
18
|
//# sourceMappingURL=Displayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Displayer.d.ts","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/Displayer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Displayer.d.ts","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/Displayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACH,aAAa,EAEb,eAAe,EAEf,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AAQ1D,eAAO,MAAM,iBAAiB,mBAG5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,SAAU,gBAAgB,cACpB,oBAAoB,KAAG,MAQ3D,CAAC;AAOF,eAAO,MAAM,WAAW,iBAAkB,GAAG,KAAG,OAK/C,CAAC;AAWF,eAAO,MAAM,oBAAoB,MAAO,IAAI,KAAG,MAK9C,CAAC;AAgBF,eAAO,MAAM,kBAAkB,UAAW,aAAa,cACrB,oBAAoB,KAAG,MAUxD,CAAC;AACF,eAAO,MAAM,YAAY,WAXS,oBAAoB,KAAG,MAWS,CAAC;AAEnE,eAAO,MAAM,aAAa,QAAS,OAAO,0BAOzC,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,oBAAoB,KAAG,MAG/D,CAAC;AAeF,eAAO,MAAM,iBAAiB,SAAU,eAAe,cAKnC,oBAAoB,KAAG,MAc1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAa,wBAAwB,cAClD,oBAAoB,KAAG,MAW1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,WAAY,oBAAoB,KAAG,MAUvE,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAmB9E;AAQD,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,UAgBvD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,gDAM3D"}
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.getFormatterFromArgs = exports.getCellRenderer = exports.getFormatter = exports.defaultDatetimeFormatter = exports.getDatetimeFormatter = exports.getFloatFormatter = exports.booleanFormatter = exports.boolDisplayer = exports.objFormatter = exports.getObjectFormatter = exports.dateDisplayerDefault = exports.isValidDate = exports.getStringFormatter = exports.basicIntFormatter = void 0;
|
|
23
23
|
var DFWhole_1 = require("./DFWhole");
|
|
24
24
|
var lodash_1 = __importDefault(require("lodash"));
|
|
25
|
-
var HistogramCell_1 = require("./HistogramCell");
|
|
26
25
|
exports.basicIntFormatter = new Intl.NumberFormat('en-US', {
|
|
27
26
|
minimumFractionDigits: 0,
|
|
28
27
|
maximumFractionDigits: 3
|
|
@@ -198,15 +197,15 @@ exports.getFormatter = getFormatter;
|
|
|
198
197
|
function getCellRenderer(crArgs) {
|
|
199
198
|
switch (crArgs.displayer) {
|
|
200
199
|
case 'histogram':
|
|
201
|
-
return
|
|
200
|
+
return 'agCheckboxCellRenderer';
|
|
202
201
|
case 'linkify':
|
|
203
|
-
return
|
|
202
|
+
return 'agCheckboxCellRenderer';
|
|
204
203
|
case 'Base64PNGImageDisplayer':
|
|
205
|
-
return
|
|
204
|
+
return 'agCheckboxCellRenderer';
|
|
206
205
|
case 'boolean_checkbox':
|
|
207
206
|
return 'agCheckboxCellRenderer';
|
|
208
207
|
case 'SVGDisplayer':
|
|
209
|
-
return
|
|
208
|
+
return 'agCheckboxCellRenderer';
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
211
|
exports.getCellRenderer = getCellRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Displayer.js","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/Displayer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,qCAQmB;AACnB,kDAAuB;
|
|
1
|
+
{"version":3,"file":"Displayer.js","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/Displayer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,qCAQmB;AACnB,kDAAuB;AAUV,QAAA,iBAAiB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC5D,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;CAC3B,CAAC,CAAC;AAEI,IAAM,kBAAkB,GAAG,UAAC,IAAsB;IACrD,IAAM,eAAe,GAAG,UAAC,MAA4B;QACjD,IAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;QACzB,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;YACxB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;SACxC;QACD,OAAO,GAAG,CAAC;IACf,CAAC,CAAC;IACF,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAC;AATW,QAAA,kBA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D,IAAM,KAAK,GAAG,QAAyB,CAAC;IACxC,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAND,oDAMC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ValueFormatterFunc } from 'ag-grid-community';
|
|
3
|
+
export declare const getTextCellRenderer: (formatter: ValueFormatterFunc<any>) => (props: any) => React.JSX.Element;
|
|
4
|
+
export declare const LinkCellRenderer: (props: any) => React.JSX.Element;
|
|
5
|
+
export declare const Base64PNGDisplayer: (props: any) => React.JSX.Element;
|
|
6
|
+
export declare const SVGDisplayer: (props: any) => React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=OtherRenderers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherRenderers.d.ts","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/OtherRenderers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,mBAAmB,cAAe,mBAAmB,GAAG,CAAC,aACjC,GAAG,sBAIvC,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,GAAG,sBAE1C,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,GAAG,sBAG5C,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,GAAG,sBAQtC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SVGDisplayer = exports.Base64PNGDisplayer = exports.LinkCellRenderer = exports.getTextCellRenderer = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var getTextCellRenderer = function (formatter) {
|
|
9
|
+
var TextCellRenderer = function (props) {
|
|
10
|
+
return react_1.default.createElement("span", null, formatter(props));
|
|
11
|
+
};
|
|
12
|
+
return TextCellRenderer;
|
|
13
|
+
};
|
|
14
|
+
exports.getTextCellRenderer = getTextCellRenderer;
|
|
15
|
+
var LinkCellRenderer = function (props) {
|
|
16
|
+
return react_1.default.createElement("a", { href: props.value }, props.value);
|
|
17
|
+
};
|
|
18
|
+
exports.LinkCellRenderer = LinkCellRenderer;
|
|
19
|
+
var Base64PNGDisplayer = function (props) {
|
|
20
|
+
var imgString = 'data:image/png;base64,' + props.value;
|
|
21
|
+
return react_1.default.createElement("img", { src: imgString });
|
|
22
|
+
};
|
|
23
|
+
exports.Base64PNGDisplayer = Base64PNGDisplayer;
|
|
24
|
+
var SVGDisplayer = function (props) {
|
|
25
|
+
var markup = { __html: props.value };
|
|
26
|
+
return (react_1.default.createElement("div", { dangerouslySetInnerHTML: markup }));
|
|
27
|
+
};
|
|
28
|
+
exports.SVGDisplayer = SVGDisplayer;
|
|
29
|
+
//# sourceMappingURL=OtherRenderers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherRenderers.js","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/OtherRenderers.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAGnB,IAAM,mBAAmB,GAAG,UAAC,SAAkC;IAClE,IAAM,gBAAgB,GAAG,UAAC,KAAU;QAChC,OAAO,4CAAO,SAAS,CAAC,KAAK,CAAC,CAAQ,CAAC;IAC3C,CAAC,CAAC;IACF,OAAO,gBAAgB,CAAC;AAC5B,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAEK,IAAM,gBAAgB,GAAG,UAAC,KAAU;IACvC,OAAO,qCAAG,IAAI,EAAE,KAAK,CAAC,KAAK,IAAG,KAAK,CAAC,KAAK,CAAK,CAAC;AACnD,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEK,IAAM,kBAAkB,GAAG,UAAC,KAAU;IACzC,IAAM,SAAS,GAAG,wBAAwB,GAAG,KAAK,CAAC,KAAK,CAAC;IACzD,OAAO,uCAAK,GAAG,EAAE,SAAS,GAAQ,CAAC;AACvC,CAAC,CAAC;AAHW,QAAA,kBAAkB,sBAG7B;AAEK,IAAM,YAAY,GAAG,UAAC,KAAU;IACnC,IAAM,MAAM,GAAG,EAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAC,CAAC;IAErC,OAAO,CACH,uCACI,uBAAuB,EAAE,MAAM,GAC5B,CACV,CAAC;AACN,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridUtils.d.ts","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/gridUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,0BAA0B,EAC1B,MAAM,EACN,mBAAmB,EACtB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"gridUtils.d.ts","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/gridUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,0BAA0B,EAC1B,MAAM,EACN,mBAAmB,EACtB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACH,OAAO,EACP,aAAa,EAGb,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,cAAc,EACjB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAkC,eAAe,EAAC,MAAM,WAAW,CAAC;AAQ3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,gCAcpF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,MAAM,CAkB5E;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,EAAE;wBAgBvC,eAAe;;;EAY7C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,qBAAqB;wBACxB,eAAe;;;EAiB7C;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,kBAiBzF;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,OAEpE;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,EAAE,wBAAwB,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAYjG;AAED,wBAAgB,0BAA0B,CACtC,qBAAqB,EAAE,MAAM,EAC7B,QAAQ,EAAE,MAAM,GACjB,OAAO,CAcT;AAED,wBAAgB,SAAS,CACrB,GAAG,EAAE,MAAM,EACX,eAAe,EAAE,cAAc,EAC/B,qBAAqB,EAAE,MAAM,GAC9B,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CA8BvB;AAGD,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,eAAe,EAAE,YAIlD,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,0BAA0B,GAAG,SAAS,CAoC9F;AAED,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAcxD"}
|
|
@@ -36,9 +36,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.extractSDFT = exports.getCellRendererSelector = exports.dfToAgrid = exports.extractSingleSeriesSummary = exports.getTooltip = exports.extractPinnedRows = exports.getStyler = exports.colorNotNull = exports.colorMap = exports.getHistoIndex = exports.addToColDef = void 0;
|
|
38
38
|
var colorMap_1 = require("../../baked_data/colorMap");
|
|
39
|
+
var OtherRenderers_1 = require("./OtherRenderers");
|
|
39
40
|
var DFWhole_1 = require("./DFWhole");
|
|
40
41
|
var lodash_1 = __importStar(require("lodash"));
|
|
41
|
-
var HistogramCell_1 = require("./HistogramCell");
|
|
42
42
|
var SeriesSummaryTooltip_1 = require("./SeriesSummaryTooltip");
|
|
43
43
|
var Displayer_1 = require("./Displayer");
|
|
44
44
|
function addToColDef(dispArgs, summary_stats_column) {
|
|
@@ -177,7 +177,7 @@ function dfToAgrid(tdf, dfviewer_config, full_summary_stats_df) {
|
|
|
177
177
|
exports.dfToAgrid = dfToAgrid;
|
|
178
178
|
function getCellRendererSelector(pinned_rows) {
|
|
179
179
|
var anyRenderer = {
|
|
180
|
-
component: (0,
|
|
180
|
+
component: (0, OtherRenderers_1.getTextCellRenderer)(Displayer_1.objFormatter)
|
|
181
181
|
};
|
|
182
182
|
return function (params) {
|
|
183
183
|
var _a;
|
|
@@ -202,7 +202,7 @@ function getCellRendererSelector(pinned_rows) {
|
|
|
202
202
|
var possibCellRenderer = (0, Displayer_1.getCellRenderer)(prc.displayer_args);
|
|
203
203
|
if (possibCellRenderer === undefined) {
|
|
204
204
|
var formattedRenderer = {
|
|
205
|
-
component: (0,
|
|
205
|
+
component: (0, OtherRenderers_1.getTextCellRenderer)((0, Displayer_1.getFormatter)(prc.displayer_args))
|
|
206
206
|
};
|
|
207
207
|
return formattedRenderer;
|
|
208
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridUtils.js","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/gridUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"gridUtils.js","sourceRoot":"","sources":["../../../src/buckaroo_js/components/DFViewerParts/gridUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,sDAAmF;AACnF,m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E,IAAI,CAAS,CAAC;AAC/C,CAAC;AAdD,kCAcC"}
|
package/buckaroo_js/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/buckaroo_js/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAC,aAAa,EAAE,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/buckaroo_js/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAC,aAAa,EAAE,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAIjD,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAErD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAS3B,CAAC"}
|
package/buckaroo_js/index.js
CHANGED
|
@@ -27,7 +27,6 @@ exports.extraComponents = exports.bakedData = void 0;
|
|
|
27
27
|
var ColumnsEditor_1 = require("./components/ColumnsEditor");
|
|
28
28
|
var DCFCell_1 = require("./components/DCFCell");
|
|
29
29
|
var DFViewer_1 = require("./components/DFViewerParts/DFViewer");
|
|
30
|
-
var HistogramCell_1 = require("./components/DFViewerParts/HistogramCell");
|
|
31
30
|
var DependentTabs_1 = require("./components/DependentTabs");
|
|
32
31
|
var Operations_1 = require("./components/Operations");
|
|
33
32
|
var StatusBar_1 = require("./components/StatusBar");
|
|
@@ -40,7 +39,6 @@ exports.extraComponents = {
|
|
|
40
39
|
ColumnsEditorEx: ColumnsEditor_1.ColumnsEditorEx,
|
|
41
40
|
DFViewer: DFViewer_1.DFViewer,
|
|
42
41
|
DFViewerEx: DFViewer_1.DFViewerEx,
|
|
43
|
-
StatusBar: StatusBar_1.StatusBar
|
|
44
|
-
HistogramCell: HistogramCell_1.HistogramCell
|
|
42
|
+
StatusBar: StatusBar_1.StatusBar
|
|
45
43
|
};
|
|
46
44
|
//# sourceMappingURL=index.js.map
|
package/buckaroo_js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/buckaroo_js/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,4DAA0E;AAC1E,gDAA0D;AAC1D,gEAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/buckaroo_js/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,4DAA0E;AAC1E,gDAA0D;AAC1D,gEAAyE;AACzE,4DAAyD;AACzD,sDAAwD;AAExD,oDAAiD;AAIjD,qEAAqD;AAExC,QAAA,eAAe,GAAG;IAC3B,aAAa,+BAAA;IACb,aAAa,+BAAA;IACb,eAAe,8BAAA;IACf,oBAAoB,gCAAA;IACpB,eAAe,iCAAA;IACf,QAAQ,qBAAA;IACR,UAAU,uBAAA;IACV,SAAS,uBAAA;CACZ,CAAC"}
|
|
@@ -1,66 +1,41 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<div className="histogram-wrap">
|
|
42
|
-
<span> Categorical All unique </span>
|
|
43
|
-
<extraComponents.HistogramCell value={all_unique}/>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div className="histogram-wrap">
|
|
47
|
-
<span> Categorical Unique with NA </span>
|
|
48
|
-
<extraComponents.HistogramCell value={unique_na}/>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<div className="histogram-wrap">
|
|
52
|
-
<span> Numeric all Unique </span>
|
|
53
|
-
<extraComponents.HistogramCell value={unique_continuous_scaled}/>
|
|
54
|
-
</div>
|
|
55
|
-
<div className="histogram-wrap">
|
|
56
|
-
<span> start station categorical </span>
|
|
57
|
-
<extraComponents.HistogramCell value={start_station_categorical}/>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<div className="histogram-wrap">
|
|
62
|
-
<span> Numeric 50% unique </span>
|
|
63
|
-
<extraComponents.HistogramCell value={unique_continuous_scaled_50}/>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {BuckarooState, extraComponents, BuckarooOptions, DFMeta} from 'buckaroo-js-core';
|
|
3
|
+
|
|
4
|
+
export default function StatusBarEx() {
|
|
5
|
+
console.clear();
|
|
6
|
+
const dfm: DFMeta = {
|
|
7
|
+
columns: 5,
|
|
8
|
+
rows_shown: 20,
|
|
9
|
+
filtered_rows: 300_000,
|
|
10
|
+
total_rows: 8_777_444
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const [bState, setBState] = useState<BuckarooState>({
|
|
14
|
+
auto_clean: 'conservative',
|
|
15
|
+
sampled: false,
|
|
16
|
+
df_display: 'main',
|
|
17
|
+
post_processing: 'asdf',
|
|
18
|
+
show_commands: false,
|
|
19
|
+
quick_command_args: {}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const bOptions: BuckarooOptions = {
|
|
23
|
+
auto_clean: ['aggressive', 'conservative'],
|
|
24
|
+
post_processing: ['', 'asdf'],
|
|
25
|
+
sampled: ['random'],
|
|
26
|
+
show_commands: ['on'],
|
|
27
|
+
df_display: ['main']
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div>
|
|
32
|
+
<extraComponents.StatusBar
|
|
33
|
+
dfMeta={dfm}
|
|
34
|
+
buckarooState={bState}
|
|
35
|
+
setBuckarooState={setBState}
|
|
36
|
+
buckarooOptions={bOptions}
|
|
37
|
+
/>
|
|
38
|
+
<pre> {JSON.stringify(bState, null, 2)}</pre>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
66
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buckaroo-js-core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Core JS/tsx components of buckaroo, packaged separately",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -46,15 +46,12 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"ag-grid-community": "^31.0.3",
|
|
48
48
|
"ag-grid-react": "^31.0.3",
|
|
49
|
-
"lodash": "^4.17.21"
|
|
50
|
-
"recharts": "^2.13.0"
|
|
49
|
+
"lodash": "^4.17.21"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
|
53
52
|
"react": "^18.0.0",
|
|
54
53
|
"react-dom": "^18.0.0"
|
|
55
54
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
55
|
"devDependencies": {
|
|
59
56
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
57
|
"@babel/plugin-transform-async-to-generator": "7.16.8",
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ObjDisplayerA
|
|
10
10
|
} from './DFWhole';
|
|
11
11
|
import _ from 'lodash';
|
|
12
|
-
import {Base64PNGDisplayer, HistogramCell, LinkCellRenderer, SVGDisplayer} from './HistogramCell';
|
|
12
|
+
//import {Base64PNGDisplayer, HistogramCell, LinkCellRenderer, SVGDisplayer} from './HistogramCell';
|
|
13
13
|
import {CellRendererArgs, FormatterArgs} from './DFWhole';
|
|
14
14
|
|
|
15
15
|
/*
|
|
@@ -194,15 +194,18 @@ export function getFormatter(fArgs: FormatterArgs): ValueFormatterFunc<unknown>
|
|
|
194
194
|
export function getCellRenderer(crArgs: CellRendererArgs) {
|
|
195
195
|
switch (crArgs.displayer) {
|
|
196
196
|
case 'histogram':
|
|
197
|
-
return
|
|
197
|
+
return 'agCheckboxCellRenderer';
|
|
198
|
+
|
|
198
199
|
case 'linkify':
|
|
199
|
-
return
|
|
200
|
+
return 'agCheckboxCellRenderer';
|
|
201
|
+
|
|
200
202
|
case 'Base64PNGImageDisplayer':
|
|
201
|
-
return
|
|
203
|
+
return 'agCheckboxCellRenderer';
|
|
204
|
+
|
|
202
205
|
case 'boolean_checkbox':
|
|
203
206
|
return 'agCheckboxCellRenderer';
|
|
204
207
|
case 'SVGDisplayer':
|
|
205
|
-
return
|
|
208
|
+
return 'agCheckboxCellRenderer';
|
|
206
209
|
}
|
|
207
210
|
}
|
|
208
211
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {ValueFormatterFunc} from 'ag-grid-community';
|
|
3
|
+
|
|
4
|
+
export const getTextCellRenderer = (formatter: ValueFormatterFunc<any>) => {
|
|
5
|
+
const TextCellRenderer = (props: any) => {
|
|
6
|
+
return <span>{formatter(props)}</span>;
|
|
7
|
+
};
|
|
8
|
+
return TextCellRenderer;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const LinkCellRenderer = (props: any) => {
|
|
12
|
+
return <a href={props.value}>{props.value}</a>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Base64PNGDisplayer = (props: any) => {
|
|
16
|
+
const imgString = 'data:image/png;base64,' + props.value;
|
|
17
|
+
return <img src={imgString}></img>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const SVGDisplayer = (props: any) => {
|
|
21
|
+
const markup = {__html: props.value};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div //style={{border:'1px solid red', borderBottom:'1px solid green'}}
|
|
25
|
+
dangerouslySetInnerHTML={markup}
|
|
26
|
+
></div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
ColDef,
|
|
5
5
|
ICellRendererParams
|
|
6
6
|
} from 'ag-grid-community';
|
|
7
|
-
import {BLUE_TO_YELLOW, DIVERGING_RED_WHITE_BLUE} from '../../baked_data/colorMap';
|
|
8
7
|
|
|
8
|
+
import {BLUE_TO_YELLOW, DIVERGING_RED_WHITE_BLUE} from '../../baked_data/colorMap';
|
|
9
|
+
import {getTextCellRenderer} from './OtherRenderers';
|
|
9
10
|
import {
|
|
10
11
|
DFWhole,
|
|
11
12
|
DisplayerArgs,
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
DFViewerConfig
|
|
19
20
|
} from './DFWhole';
|
|
20
21
|
import _, {zipObject} from 'lodash';
|
|
21
|
-
import {getTextCellRenderer} from './HistogramCell';
|
|
22
|
+
//import {getTextCellRenderer} from './HistogramCell';
|
|
22
23
|
|
|
23
24
|
import {DFData, SDFMeasure, SDFT} from './DFWhole';
|
|
24
25
|
|
|
@@ -49,7 +50,7 @@ export function addToColDef(dispArgs: DisplayerArgs, summary_stats_column: SDFMe
|
|
|
49
50
|
export function getHistoIndex(val: number, histogram_edges: number[]): number {
|
|
50
51
|
/*
|
|
51
52
|
np.histogram([1, 2, 3, 4, 10, 20, 30, 40, 300, 300, 400, 500], bins=5)
|
|
52
|
-
( [ 8, 0, 2, 1, 1],
|
|
53
|
+
( [ 8, 0, 2, 1, 1],
|
|
53
54
|
[ 1. , 100.8, 200.6, 300.4, 400.2, 500. ])
|
|
54
55
|
The bottom matters for us, those are the endge
|
|
55
56
|
|
package/src/buckaroo_js/index.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import {ColumnsEditor, ColumnsEditorEx} from './components/ColumnsEditor';
|
|
5
5
|
import {WidgetDCFCellExample} from './components/DCFCell';
|
|
6
6
|
import {DFViewer, DFViewerEx} from './components/DFViewerParts/DFViewer';
|
|
7
|
-
import {HistogramCell} from './components/DFViewerParts/HistogramCell';
|
|
8
7
|
import {DependentTabs} from './components/DependentTabs';
|
|
9
8
|
import {OperationViewer} from './components/Operations';
|
|
10
9
|
//import { DFData, DFViewerConfig } from './components/DFViewerParts/DFWhole';
|
|
@@ -22,13 +21,12 @@ export const extraComponents = {
|
|
|
22
21
|
ColumnsEditorEx,
|
|
23
22
|
DFViewer,
|
|
24
23
|
DFViewerEx,
|
|
25
|
-
StatusBar
|
|
26
|
-
HistogramCell
|
|
24
|
+
StatusBar
|
|
27
25
|
};
|
|
28
26
|
|
|
29
27
|
/*
|
|
30
|
-
export const typing = {
|
|
31
|
-
DFData,
|
|
28
|
+
export const typing = {
|
|
29
|
+
DFData,
|
|
32
30
|
DFViewerConfig
|
|
33
31
|
};
|
|
34
32
|
*/
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import {createPortal} from 'react-dom';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
BarChart,
|
|
7
|
-
Bar
|
|
8
|
-
//Tooltip,
|
|
9
|
-
//Legend,
|
|
10
|
-
//Cell, XAxis, YAxis, CartesianGrid, , ResponsiveContainer,
|
|
11
|
-
} from 'recharts';
|
|
12
|
-
import {Tooltip} from '../../vendor/RechartTooltip';
|
|
13
|
-
|
|
14
|
-
import {isNumOrStr, ValueType} from '../../vendor/RechartExtra';
|
|
15
|
-
import {ValueFormatterFunc} from 'ag-grid-community';
|
|
16
|
-
|
|
17
|
-
function defaultFormatter<TValue extends ValueType>(value: TValue) {
|
|
18
|
-
return _.isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1])
|
|
19
|
-
? // ? (value.join(' ~ ') as TValue)
|
|
20
|
-
('{value[0]} ~ {value[1]}' as TValue)
|
|
21
|
-
: value;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const bakedData = [
|
|
25
|
-
{
|
|
26
|
-
name: 'Page A',
|
|
27
|
-
population: 4000
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'Page B',
|
|
31
|
-
population: 3000
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'Page C',
|
|
35
|
-
population: 2000
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'Page D',
|
|
39
|
-
population: 2780
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'Page E',
|
|
43
|
-
population: 1890
|
|
44
|
-
}
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
export interface HistogramNode {
|
|
48
|
-
name: string;
|
|
49
|
-
population: number;
|
|
50
|
-
}
|
|
51
|
-
export const makeData = (histogram: number[]) => {
|
|
52
|
-
const accum: HistogramNode[] = [];
|
|
53
|
-
for (let i = 0; i < histogram.length; i++) {
|
|
54
|
-
accum.push({
|
|
55
|
-
name: `${i + 1}/${histogram.length}`,
|
|
56
|
-
population: histogram[i]
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//console.log('accum', accum)
|
|
60
|
-
return accum;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const formatter = (value: any, name: any, props: any) => {
|
|
64
|
-
if (props.payload.name === 'longtail') {
|
|
65
|
-
return [value, name];
|
|
66
|
-
} else {
|
|
67
|
-
return [value, props.payload.name];
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export function FloatingTooltip({items, x, y}: any) {
|
|
72
|
-
const offset = 30;
|
|
73
|
-
const renderedItems = items.map((name: [string, number], value: number | string) => {
|
|
74
|
-
const [realName, realValue] = name;
|
|
75
|
-
const formattedVal = realValue === 0 ? '<1' : realValue;
|
|
76
|
-
return (
|
|
77
|
-
<React.Fragment>
|
|
78
|
-
<dt>{realName}</dt>
|
|
79
|
-
<dd>{formattedVal}%</dd>
|
|
80
|
-
</React.Fragment>
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
|
-
return createPortal(
|
|
84
|
-
<div
|
|
85
|
-
className='floating-tooltip'
|
|
86
|
-
style={{position: 'absolute', top: y + offset, left: x + offset}}
|
|
87
|
-
>
|
|
88
|
-
<dl>{renderedItems}</dl>
|
|
89
|
-
</div>,
|
|
90
|
-
document.body
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export const ToolTipAdapter = (args: any) => {
|
|
95
|
-
const {active, formatter, payload} = args;
|
|
96
|
-
if (active && payload && payload.length) {
|
|
97
|
-
const renderContent2 = () => {
|
|
98
|
-
//const items = (itemSorter ? _.sortBy(payload, itemSorter) : payload).map((entry, i) => {
|
|
99
|
-
const items = payload.map((entry: any, i: number) => {
|
|
100
|
-
if (entry.type === 'none') {
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const finalFormatter = entry.formatter || formatter || defaultFormatter;
|
|
105
|
-
const {value, name} = entry;
|
|
106
|
-
let finalValue: React.ReactNode = value;
|
|
107
|
-
let finalName: React.ReactNode = name;
|
|
108
|
-
if (finalFormatter && finalValue !== null && finalName !== null) {
|
|
109
|
-
const formatted = finalFormatter(value, name, entry, i, payload);
|
|
110
|
-
if (Array.isArray(formatted)) {
|
|
111
|
-
[finalValue, finalName] = formatted;
|
|
112
|
-
} else {
|
|
113
|
-
finalValue = formatted;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return [finalName, finalValue];
|
|
118
|
-
});
|
|
119
|
-
return items;
|
|
120
|
-
};
|
|
121
|
-
return (
|
|
122
|
-
<div className='custom-tooltip'>
|
|
123
|
-
<FloatingTooltip items={renderContent2()} x={args.box.x} y={args.box.y} />
|
|
124
|
-
</div>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return null;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export const getTextCellRenderer = (formatter: ValueFormatterFunc<any>) => {
|
|
132
|
-
const TextCellRenderer = (props: any) => {
|
|
133
|
-
return <span>{formatter(props)}</span>;
|
|
134
|
-
};
|
|
135
|
-
return TextCellRenderer;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const LinkCellRenderer = (props: any) => {
|
|
139
|
-
return <a href={props.value}>{props.value}</a>;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const Base64PNGDisplayer = (props: any) => {
|
|
143
|
-
const imgString = 'data:image/png;base64,' + props.value;
|
|
144
|
-
return <img src={imgString}></img>;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export const SVGDisplayer = (props: any) => {
|
|
148
|
-
const markup = {__html: props.value};
|
|
149
|
-
|
|
150
|
-
return (
|
|
151
|
-
<div //style={{border:'1px solid red', borderBottom:'1px solid green'}}
|
|
152
|
-
dangerouslySetInnerHTML={markup}
|
|
153
|
-
></div>
|
|
154
|
-
);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const HistogramCell = (props: any) => {
|
|
158
|
-
//debugger;
|
|
159
|
-
if (props === undefined || props.value === undefined) {
|
|
160
|
-
return <span></span>;
|
|
161
|
-
}
|
|
162
|
-
const histogram = props.value;
|
|
163
|
-
//for key "index", the value is "histogram"
|
|
164
|
-
// this causes ReChart to blow up, so we check to see if it's an array
|
|
165
|
-
if (histogram === undefined || !_.isArray(histogram)) {
|
|
166
|
-
return <span></span>;
|
|
167
|
-
}
|
|
168
|
-
const dumbClickHandler = (rechartsArgs: any, _unused_react: any) => {
|
|
169
|
-
// I can't find the type for rechartsArgs
|
|
170
|
-
// these are probably the keys we care about
|
|
171
|
-
// activeTooltipIndex
|
|
172
|
-
// activeLabel
|
|
173
|
-
console.log('dumbClickHandler', rechartsArgs);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<div className='histogram-component'>
|
|
178
|
-
<BarChart
|
|
179
|
-
width={100}
|
|
180
|
-
height={24}
|
|
181
|
-
barGap={1}
|
|
182
|
-
data={histogram}
|
|
183
|
-
onClick={dumbClickHandler}
|
|
184
|
-
>
|
|
185
|
-
<defs>
|
|
186
|
-
<pattern id='star' width='10' height='10' patternUnits='userSpaceOnUse'>
|
|
187
|
-
<polygon stroke='pink' points='0,0 2,5 0,10 5,8 10,10 8,5 10,0 5,2' />
|
|
188
|
-
</pattern>
|
|
189
|
-
<pattern
|
|
190
|
-
id='stripe'
|
|
191
|
-
width='4'
|
|
192
|
-
height='4'
|
|
193
|
-
patternUnits='userSpaceOnUse'
|
|
194
|
-
patternTransform='rotate(45)'
|
|
195
|
-
>
|
|
196
|
-
<rect width='2' height='4' fill='red' />
|
|
197
|
-
</pattern>
|
|
198
|
-
<pattern id='circles' width='4' height='4' patternUnits='userSpaceOnUse'>
|
|
199
|
-
<circle data-color='outline' stroke='pink' cx='.5' cy='.5' r='1.5'></circle>
|
|
200
|
-
</pattern>
|
|
201
|
-
|
|
202
|
-
<pattern
|
|
203
|
-
id='checkers'
|
|
204
|
-
x='0'
|
|
205
|
-
y='0'
|
|
206
|
-
width='4'
|
|
207
|
-
height='4'
|
|
208
|
-
patternUnits='userSpaceOnUse'
|
|
209
|
-
>
|
|
210
|
-
<rect stroke='#0f0' x='0' width='2' height='2' y='0'></rect>
|
|
211
|
-
<rect x='2' width='2' height='2' y='2'></rect>
|
|
212
|
-
</pattern>
|
|
213
|
-
|
|
214
|
-
<pattern
|
|
215
|
-
id='leafs'
|
|
216
|
-
x='0'
|
|
217
|
-
y='0'
|
|
218
|
-
width='6'
|
|
219
|
-
height='6'
|
|
220
|
-
patternUnits='userSpaceOnUse'
|
|
221
|
-
patternTransform='translate(1, 1) rotate(0) skewX(0)'
|
|
222
|
-
>
|
|
223
|
-
<svg width='5' height='5' viewBox='0 0 100 100'>
|
|
224
|
-
<g fill='teal' opacity='1'>
|
|
225
|
-
<path d='M99.9557 99.9557C45.4895 98.3748 1.6248 54.5101 0.0439453 0.0439453C54.5101 1.6248 98.3748 45.4895 99.9557 99.9557Z'></path>
|
|
226
|
-
</g>
|
|
227
|
-
</svg>
|
|
228
|
-
</pattern>
|
|
229
|
-
</defs>
|
|
230
|
-
<Bar dataKey='population' stroke='#000' fill='gray' stackId='stack' />
|
|
231
|
-
<Bar dataKey='tail' stroke='#000' fill='gray' stackId='stack' />
|
|
232
|
-
<Bar dataKey='true' stroke='#00f' fill='#00f' stackId='stack' />
|
|
233
|
-
<Bar dataKey='false' stroke='#000' fill='#fff' stackId='stack' />
|
|
234
|
-
<Bar dataKey='cat_pop' stroke='pink' fill='url(#circles)' stackId='stack' />
|
|
235
|
-
<Bar dataKey='unique' stroke='#0f0' fill='url(#checkers)' stackId='stack' />
|
|
236
|
-
<Bar dataKey='longtail' stroke='teal' fill='url(#leafs)' stackId='stack' />
|
|
237
|
-
<Bar dataKey='NA' fill='url(#stripe)' stackId='stack' />
|
|
238
|
-
|
|
239
|
-
<Tooltip
|
|
240
|
-
formatter={formatter}
|
|
241
|
-
labelStyle={{display: 'None'}}
|
|
242
|
-
wrapperStyle={{zIndex: 999991}}
|
|
243
|
-
contentStyle={{color: 'black'}}
|
|
244
|
-
content={<ToolTipAdapter />}
|
|
245
|
-
offset={20}
|
|
246
|
-
allowEscapeViewBox={{x: true}}
|
|
247
|
-
/>
|
|
248
|
-
</BarChart>
|
|
249
|
-
</div>
|
|
250
|
-
);
|
|
251
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module contains the standard library from rechart so that base rechart code cna be imported with the minimum amount of rewriting
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import _ from 'lodash';
|
|
6
|
-
import {CSSProperties, ReactNode} from 'react';
|
|
7
|
-
export {Global, DefaultTooltipContent} from 'recharts';
|
|
8
|
-
|
|
9
|
-
//export Global;
|
|
10
|
-
|
|
11
|
-
//import { AnimationDuration, AnimationTiming } from '../util/types';
|
|
12
|
-
/** The type of easing function to use for animations */
|
|
13
|
-
export type AnimationTiming = 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
|
|
14
|
-
/** Specifies the duration of animation, the unit of this option is ms. */
|
|
15
|
-
export type AnimationDuration = number;
|
|
16
|
-
|
|
17
|
-
export type TooltipType = 'none';
|
|
18
|
-
export type ValueType = number | string | Array<number | string>;
|
|
19
|
-
export type NameType = number | string;
|
|
20
|
-
|
|
21
|
-
export type Formatter<TValue extends ValueType, TName extends NameType> = (
|
|
22
|
-
value: TValue,
|
|
23
|
-
name: TName,
|
|
24
|
-
item: Payload<TValue, TName>,
|
|
25
|
-
index: number,
|
|
26
|
-
payload: Array<Payload<TValue, TName>>
|
|
27
|
-
) => [React.ReactNode, TName] | React.ReactNode;
|
|
28
|
-
|
|
29
|
-
export interface Payload<TValue extends ValueType, TName extends NameType> {
|
|
30
|
-
type?: TooltipType;
|
|
31
|
-
color?: string;
|
|
32
|
-
formatter?: Formatter<TValue, TName>;
|
|
33
|
-
name?: TName;
|
|
34
|
-
value?: TValue;
|
|
35
|
-
unit?: ReactNode;
|
|
36
|
-
dataKey?: string | number;
|
|
37
|
-
payload?: any;
|
|
38
|
-
chartType?: string;
|
|
39
|
-
stroke?: string;
|
|
40
|
-
strokeDasharray?: string | number;
|
|
41
|
-
strokeWidth?: number | string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface DefaultProps<TValue extends ValueType, TName extends NameType> {
|
|
45
|
-
separator?: string;
|
|
46
|
-
wrapperClassName?: string;
|
|
47
|
-
labelClassName?: string;
|
|
48
|
-
formatter?: Formatter<TValue, TName>;
|
|
49
|
-
contentStyle?: CSSProperties;
|
|
50
|
-
itemStyle?: CSSProperties;
|
|
51
|
-
labelStyle?: CSSProperties;
|
|
52
|
-
labelFormatter?: (label: any, payload: Array<Payload<TValue, TName>>) => ReactNode;
|
|
53
|
-
label?: any;
|
|
54
|
-
payload?: Array<Payload<TValue, TName>>;
|
|
55
|
-
itemSorter?: (item: Payload<TValue, TName>) => number | string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const isNumber = (value: unknown): value is number => _.isNumber(value) && !_.isNaN(value);
|
|
59
|
-
export const isNumOrStr = (value: unknown): value is number | string =>
|
|
60
|
-
isNumber(value as number) || _.isString(value);
|
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
//@ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* Reimplementation of rechart tooltips. most of this is copied from ??? in the recharts source tree because the parts we are editting are deeply embedded into functions.
|
|
4
|
-
|
|
5
|
-
Most of the point of this is to get tooltips to be absolutely positioned off of document.body, not the nearest parent element. AG-Grid hides those tooltips otherwise.
|
|
6
|
-
*/
|
|
7
|
-
import React, {
|
|
8
|
-
CSSProperties,
|
|
9
|
-
ReactNode,
|
|
10
|
-
ReactElement,
|
|
11
|
-
SVGProps,
|
|
12
|
-
useEffect,
|
|
13
|
-
useState,
|
|
14
|
-
useRef,
|
|
15
|
-
useCallback
|
|
16
|
-
} from 'react';
|
|
17
|
-
import _ from 'lodash';
|
|
18
|
-
//import classNames from 'classnames';
|
|
19
|
-
|
|
20
|
-
//import { DefaultTooltipContent, ValueType, NameType, Payload, Props as DefaultProps } from './DefaultTooltipContent';
|
|
21
|
-
|
|
22
|
-
import type {ValueType, NameType, Payload, DefaultProps} from './RechartExtra';
|
|
23
|
-
//import { Global } from '../util/Global';
|
|
24
|
-
//import { isNumber } from '../util/DataUtils';
|
|
25
|
-
import {Global, isNumber} from './RechartExtra';
|
|
26
|
-
|
|
27
|
-
//import { AnimationDuration, AnimationTiming } from '../util/types';
|
|
28
|
-
import {AnimationDuration, AnimationTiming} from './RechartExtra';
|
|
29
|
-
|
|
30
|
-
import {DefaultTooltipContent} from 'recharts';
|
|
31
|
-
|
|
32
|
-
const CLS_PREFIX = 'recharts-tooltip-wrapper';
|
|
33
|
-
|
|
34
|
-
const EPS = 1;
|
|
35
|
-
|
|
36
|
-
export type ContentType<TValue extends ValueType, TName extends NameType> =
|
|
37
|
-
| ReactElement
|
|
38
|
-
| ((props: TooltipProps<TValue, TName>) => ReactNode);
|
|
39
|
-
|
|
40
|
-
type UniqueFunc<TValue extends ValueType, TName extends NameType> = (
|
|
41
|
-
entry: Payload<TValue, TName>
|
|
42
|
-
) => unknown;
|
|
43
|
-
type UniqueOption<TValue extends ValueType, TName extends NameType> =
|
|
44
|
-
| boolean
|
|
45
|
-
| UniqueFunc<TValue, TName>;
|
|
46
|
-
function defaultUniqBy<TValue extends ValueType, TName extends NameType>(
|
|
47
|
-
entry: Payload<TValue, TName>
|
|
48
|
-
) {
|
|
49
|
-
return entry.dataKey;
|
|
50
|
-
}
|
|
51
|
-
function getUniqPayload<TValue extends ValueType, TName extends NameType>(
|
|
52
|
-
option: UniqueOption<TValue, TName>,
|
|
53
|
-
payload: Array<Payload<TValue, TName>>
|
|
54
|
-
) {
|
|
55
|
-
if (option === true) {
|
|
56
|
-
//@ts-ignore
|
|
57
|
-
return _.uniqBy(payload, defaultUniqBy);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (_.isFunction(option)) {
|
|
61
|
-
return _.uniqBy(payload, option);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return payload;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function renderContent<TValue extends ValueType, TName extends NameType>(
|
|
68
|
-
content: ContentType<TValue, TName>,
|
|
69
|
-
props: TooltipProps<TValue, TName>
|
|
70
|
-
) {
|
|
71
|
-
if (React.isValidElement(content)) {
|
|
72
|
-
return React.cloneElement(content, props);
|
|
73
|
-
}
|
|
74
|
-
if (_.isFunction(content)) {
|
|
75
|
-
return React.createElement(content as any, props);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return <DefaultTooltipContent {...props} />;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export type OptionalCoords = {
|
|
82
|
-
x?: number;
|
|
83
|
-
y?: number;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export type TooltipProps<TValue extends ValueType, TName extends NameType> = DefaultProps<
|
|
87
|
-
TValue,
|
|
88
|
-
TName
|
|
89
|
-
> & {
|
|
90
|
-
allowEscapeViewBox?: {
|
|
91
|
-
x?: boolean;
|
|
92
|
-
y?: boolean;
|
|
93
|
-
};
|
|
94
|
-
reverseDirection?: {
|
|
95
|
-
x?: boolean;
|
|
96
|
-
y?: boolean;
|
|
97
|
-
};
|
|
98
|
-
content?: ContentType<TValue, TName>;
|
|
99
|
-
viewBox?: {
|
|
100
|
-
x?: number;
|
|
101
|
-
y?: number;
|
|
102
|
-
width?: number;
|
|
103
|
-
height?: number;
|
|
104
|
-
};
|
|
105
|
-
active?: boolean;
|
|
106
|
-
offset?: number;
|
|
107
|
-
wrapperStyle?: CSSProperties;
|
|
108
|
-
cursor?: boolean | ReactElement | SVGProps<SVGElement>;
|
|
109
|
-
coordinate?: OptionalCoords;
|
|
110
|
-
position?: OptionalCoords;
|
|
111
|
-
trigger?: 'hover' | 'click';
|
|
112
|
-
shared?: boolean;
|
|
113
|
-
payloadUniqBy?: UniqueOption<TValue, TName>;
|
|
114
|
-
isAnimationActive?: boolean;
|
|
115
|
-
animationDuration?: AnimationDuration;
|
|
116
|
-
animationEasing?: AnimationTiming;
|
|
117
|
-
filterNull?: boolean;
|
|
118
|
-
useTranslate3d?: boolean;
|
|
119
|
-
box?: OptionalCoords;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const tooltipDefaultProps: TooltipProps<number, string> = {
|
|
123
|
-
active: false,
|
|
124
|
-
allowEscapeViewBox: {x: false, y: false},
|
|
125
|
-
reverseDirection: {x: false, y: false},
|
|
126
|
-
offset: 10,
|
|
127
|
-
viewBox: {x: 0, y: 0, height: 0, width: 0},
|
|
128
|
-
coordinate: {x: 0, y: 0},
|
|
129
|
-
// this doesn't exist on TooltipProps
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
131
|
-
// @ts-ignore
|
|
132
|
-
cursorStyle: {},
|
|
133
|
-
separator: ' : ',
|
|
134
|
-
wrapperStyle: {},
|
|
135
|
-
contentStyle: {},
|
|
136
|
-
itemStyle: {},
|
|
137
|
-
labelStyle: {},
|
|
138
|
-
cursor: true,
|
|
139
|
-
trigger: 'hover',
|
|
140
|
-
isAnimationActive: !Global.isSsr,
|
|
141
|
-
animationEasing: 'ease',
|
|
142
|
-
animationDuration: 400,
|
|
143
|
-
filterNull: true,
|
|
144
|
-
useTranslate3d: false,
|
|
145
|
-
box: {x: 0, y: 0}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export const Tooltip = <TValue extends ValueType, TName extends NameType>(
|
|
149
|
-
props: TooltipProps<TValue, TName> & {children?: React.ReactNode}
|
|
150
|
-
) => {
|
|
151
|
-
const [boxWidth, setBoxWidth] = useState(-1);
|
|
152
|
-
const [boxHeight, setBoxHeight] = useState(-1);
|
|
153
|
-
const [dismissed, setDismissed] = useState(false);
|
|
154
|
-
const [dismissedAtCoordinate, setDismissedAtCoordinate] = useState({
|
|
155
|
-
x: 0,
|
|
156
|
-
y: 0
|
|
157
|
-
});
|
|
158
|
-
const [boxCoords, setBoxCoords] = useState({x: 0, y: 0});
|
|
159
|
-
|
|
160
|
-
const wrapperNode = useRef<HTMLDivElement>();
|
|
161
|
-
const {allowEscapeViewBox, reverseDirection, coordinate, offset, position, viewBox} = props;
|
|
162
|
-
|
|
163
|
-
const handleKeyDown = useCallback(
|
|
164
|
-
(event: KeyboardEvent) => {
|
|
165
|
-
if (event.key === 'Escape') {
|
|
166
|
-
setDismissed(true);
|
|
167
|
-
setDismissedAtCoordinate((prev) => ({
|
|
168
|
-
...prev,
|
|
169
|
-
x: coordinate?.x,
|
|
170
|
-
y: coordinate?.y
|
|
171
|
-
}));
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
[coordinate?.x, coordinate?.y]
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
useEffect(() => {
|
|
178
|
-
const updateBBox = () => {
|
|
179
|
-
if (dismissed) {
|
|
180
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
181
|
-
if (
|
|
182
|
-
coordinate?.x !== dismissedAtCoordinate.x ||
|
|
183
|
-
coordinate?.y !== dismissedAtCoordinate.y
|
|
184
|
-
) {
|
|
185
|
-
setDismissed(false);
|
|
186
|
-
}
|
|
187
|
-
} else {
|
|
188
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (wrapperNode.current && wrapperNode.current.getBoundingClientRect) {
|
|
192
|
-
const box = wrapperNode.current.getBoundingClientRect();
|
|
193
|
-
setBoxCoords({x: box.x, y: box.y});
|
|
194
|
-
if (
|
|
195
|
-
Math.abs(box.width - boxWidth) > EPS ||
|
|
196
|
-
Math.abs(box.height - boxHeight) > EPS
|
|
197
|
-
) {
|
|
198
|
-
setBoxWidth(box.width);
|
|
199
|
-
setBoxHeight(box.height);
|
|
200
|
-
}
|
|
201
|
-
} else if (boxWidth !== -1 || boxHeight !== -1) {
|
|
202
|
-
setBoxWidth(-1);
|
|
203
|
-
setBoxHeight(-1);
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
updateBBox();
|
|
208
|
-
|
|
209
|
-
return () => {
|
|
210
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
211
|
-
};
|
|
212
|
-
}, [
|
|
213
|
-
boxHeight,
|
|
214
|
-
boxWidth,
|
|
215
|
-
coordinate,
|
|
216
|
-
dismissed,
|
|
217
|
-
dismissedAtCoordinate.x,
|
|
218
|
-
dismissedAtCoordinate.y,
|
|
219
|
-
handleKeyDown
|
|
220
|
-
]);
|
|
221
|
-
|
|
222
|
-
const getTranslate = ({
|
|
223
|
-
key,
|
|
224
|
-
tooltipDimension,
|
|
225
|
-
viewBoxDimension
|
|
226
|
-
}: {
|
|
227
|
-
key: 'x' | 'y';
|
|
228
|
-
tooltipDimension: number;
|
|
229
|
-
viewBoxDimension: number;
|
|
230
|
-
}) => {
|
|
231
|
-
if (position && isNumber(position[key])) {
|
|
232
|
-
return position[key];
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const pCoordinate = coordinate || {x: 0, y: 0};
|
|
236
|
-
const negative = (pCoordinate[key] || 0) - tooltipDimension - (offset || 0);
|
|
237
|
-
const positive = (pCoordinate[key] || 0) + offset;
|
|
238
|
-
if (allowEscapeViewBox?.[key]) {
|
|
239
|
-
return reverseDirection[key] ? negative : positive;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (reverseDirection?.[key]) {
|
|
243
|
-
const tooltipBoundary = negative;
|
|
244
|
-
const viewBoxBoundary = viewBox[key];
|
|
245
|
-
if (tooltipBoundary < viewBoxBoundary) {
|
|
246
|
-
return Math.max(positive, viewBox[key]);
|
|
247
|
-
}
|
|
248
|
-
return Math.max(negative, viewBox[key]);
|
|
249
|
-
}
|
|
250
|
-
const tooltipBoundary = positive + tooltipDimension;
|
|
251
|
-
const viewBoxBoundary = viewBox[key] + viewBoxDimension;
|
|
252
|
-
if (tooltipBoundary > viewBoxBoundary) {
|
|
253
|
-
return Math.max(negative, viewBox[key]);
|
|
254
|
-
}
|
|
255
|
-
return Math.max(positive, viewBox[key]);
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
const {
|
|
259
|
-
payload,
|
|
260
|
-
payloadUniqBy,
|
|
261
|
-
filterNull,
|
|
262
|
-
active,
|
|
263
|
-
wrapperStyle,
|
|
264
|
-
useTranslate3d,
|
|
265
|
-
isAnimationActive,
|
|
266
|
-
animationDuration,
|
|
267
|
-
animationEasing
|
|
268
|
-
} = props;
|
|
269
|
-
const finalPayload = getUniqPayload(
|
|
270
|
-
payloadUniqBy,
|
|
271
|
-
filterNull && payload && payload.length
|
|
272
|
-
? payload.filter((entry) => !_.isNil(entry.value))
|
|
273
|
-
: payload
|
|
274
|
-
);
|
|
275
|
-
const hasPayload = finalPayload && finalPayload.length;
|
|
276
|
-
const {content} = props;
|
|
277
|
-
let outerStyle: CSSProperties = {
|
|
278
|
-
pointerEvents: 'none',
|
|
279
|
-
visibility: !dismissed && active && hasPayload ? 'visible' : 'hidden',
|
|
280
|
-
position: 'absolute',
|
|
281
|
-
top: 0,
|
|
282
|
-
left: 0,
|
|
283
|
-
...wrapperStyle
|
|
284
|
-
};
|
|
285
|
-
let translateX, translateY;
|
|
286
|
-
|
|
287
|
-
if (position && isNumber(position.x) && isNumber(position.y)) {
|
|
288
|
-
translateX = position.x;
|
|
289
|
-
translateY = position.y;
|
|
290
|
-
} else if (boxWidth > 0 && boxHeight > 0 && coordinate) {
|
|
291
|
-
translateX = getTranslate({
|
|
292
|
-
key: 'x',
|
|
293
|
-
tooltipDimension: boxWidth,
|
|
294
|
-
viewBoxDimension: viewBox.width
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
translateY = getTranslate({
|
|
298
|
-
key: 'y',
|
|
299
|
-
tooltipDimension: boxHeight,
|
|
300
|
-
viewBoxDimension: viewBox.height
|
|
301
|
-
});
|
|
302
|
-
} else {
|
|
303
|
-
outerStyle.visibility = 'hidden';
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
outerStyle = {
|
|
307
|
-
...{
|
|
308
|
-
transform: useTranslate3d
|
|
309
|
-
? `translate3d(${translateX}px, ${translateY}px, 0)`
|
|
310
|
-
: `translate(${translateX}px, ${translateY}px)`
|
|
311
|
-
},
|
|
312
|
-
...outerStyle
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
if (isAnimationActive && active) {
|
|
316
|
-
outerStyle = {
|
|
317
|
-
...{
|
|
318
|
-
transition: `transform ${animationDuration}ms ${animationEasing}`
|
|
319
|
-
},
|
|
320
|
-
...outerStyle
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// eslint-disable-next-line
|
|
325
|
-
// const cls = classNames(CLS_PREFIX, {
|
|
326
|
-
// [`${CLS_PREFIX}-right`]: isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x,
|
|
327
|
-
// [`${CLS_PREFIX}-left`]: isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x,
|
|
328
|
-
// [`${CLS_PREFIX}-bottom`]:
|
|
329
|
-
// isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y,
|
|
330
|
-
// [`${CLS_PREFIX}-top`]: isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y,
|
|
331
|
-
// });
|
|
332
|
-
|
|
333
|
-
const cls = `${CLS_PREFIX}-top`;
|
|
334
|
-
return (
|
|
335
|
-
// ESLint is disabled to allow listening to the `Escape` key. Refer to
|
|
336
|
-
// https://github.com/recharts/recharts/pull/2925
|
|
337
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
338
|
-
<div tabIndex={-1} role='dialog' className={cls} style={outerStyle} ref={wrapperNode}>
|
|
339
|
-
{renderContent(content, {
|
|
340
|
-
...props,
|
|
341
|
-
box: boxCoords,
|
|
342
|
-
payload: finalPayload
|
|
343
|
-
})}
|
|
344
|
-
</div>
|
|
345
|
-
);
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
// needs to be set so that renderByOrder can find the correct handler function
|
|
349
|
-
Tooltip.displayName = 'Tooltip';
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* needs to be set so that renderByOrder can access an have default values for
|
|
353
|
-
* children.props when there are no props set by the consumer
|
|
354
|
-
* doesn't work if using default parameters
|
|
355
|
-
*/
|
|
356
|
-
Tooltip.defaultProps = tooltipDefaultProps;
|