@recharts/devtools 0.0.4 → 0.0.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/README.md +2 -0
- package/dist/components/RechartsDevtools.js +58 -0
- package/dist/components/useEventDispatch.js +11 -0
- package/dist/constants.js +1 -0
- package/dist/context/RechartsDevtoolsContext.js +19 -0
- package/dist/generateMockData.js +14 -0
- package/dist/{src/hooks → hooks}/useSessionStorageState.js +6 -9
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/{src/inspectors → inspectors}/ActiveTooltipLabelInspector.d.ts +1 -1
- package/dist/inspectors/ActiveTooltipLabelInspector.js +12 -0
- package/dist/{src/inspectors → inspectors}/ChartDimensionInspector.d.ts +1 -1
- package/dist/inspectors/ChartDimensionInspector.js +18 -0
- package/dist/{src/inspectors → inspectors}/MarginInspector.d.ts +1 -1
- package/dist/inspectors/MarginInspector.js +37 -0
- package/dist/{src/inspectors → inspectors}/OffsetInspector.d.ts +1 -1
- package/dist/inspectors/OffsetInspector.js +39 -0
- package/dist/{src/inspectors → inspectors}/PlotAreaInspector.d.ts +1 -1
- package/dist/inspectors/PlotAreaInspector.js +30 -0
- package/dist/{src/inspectors → inspectors}/UseActiveTooltipDataPointsInspector.d.ts +1 -1
- package/dist/inspectors/UseActiveTooltipDataPointsInspector.js +12 -0
- package/dist/{src/inspectors → inspectors}/XAxisDomainInspector.d.ts +1 -1
- package/dist/inspectors/XAxisDomainInspector.js +12 -0
- package/dist/{src/inspectors → inspectors}/YAxisDomainInspector.d.ts +1 -1
- package/dist/inspectors/YAxisDomainInspector.js +12 -0
- package/dist/inspectors/generic/ArrayInspector.js +27 -0
- package/dist/inspectors/generic/ObjectInspector.js +43 -0
- package/dist/inspectors/generic/PrimitiveInspector.js +8 -0
- package/dist/inspectors/utils/SvgDimensionShower.js +60 -0
- package/dist/{src/random.js → random.js} +2 -6
- package/package.json +11 -8
- package/dist/src/components/RechartsDevtools.js +0 -65
- package/dist/src/components/useEventDispatch.js +0 -14
- package/dist/src/constants.js +0 -4
- package/dist/src/context/RechartsDevtoolsContext.js +0 -58
- package/dist/src/generateMockData.js +0 -17
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +0 -21
- package/dist/src/inspectors/ActiveTooltipLabelInspector.js +0 -18
- package/dist/src/inspectors/ChartDimensionInspector.js +0 -24
- package/dist/src/inspectors/MarginInspector.js +0 -43
- package/dist/src/inspectors/OffsetInspector.js +0 -45
- package/dist/src/inspectors/PlotAreaInspector.js +0 -36
- package/dist/src/inspectors/UseActiveTooltipDataPointsInspector.js +0 -18
- package/dist/src/inspectors/XAxisDomainInspector.js +0 -18
- package/dist/src/inspectors/YAxisDomainInspector.js +0 -18
- package/dist/src/inspectors/generic/ArrayInspector.js +0 -63
- package/dist/src/inspectors/generic/ObjectInspector.js +0 -77
- package/dist/src/inspectors/generic/PrimitiveInspector.js +0 -15
- package/dist/src/inspectors/utils/SvgDimensionShower.js +0 -66
- package/dist/src/types.js +0 -2
- package/dist/test/generateMockData.spec.js +0 -27
- package/dist/test/random.spec.d.ts +0 -1
- package/dist/test/random.spec.js +0 -30
- /package/dist/{src/components → components}/RechartsDevtools.d.ts +0 -0
- /package/dist/{src/components → components}/useEventDispatch.d.ts +0 -0
- /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{src/context → context}/RechartsDevtoolsContext.d.ts +0 -0
- /package/dist/{src/generateMockData.d.ts → generateMockData.d.ts} +0 -0
- /package/dist/{src/hooks → hooks}/useSessionStorageState.d.ts +0 -0
- /package/dist/{src/inspectors → inspectors}/generic/ArrayInspector.d.ts +0 -0
- /package/dist/{src/inspectors → inspectors}/generic/ObjectInspector.d.ts +0 -0
- /package/dist/{src/inspectors → inspectors}/generic/PrimitiveInspector.d.ts +0 -0
- /package/dist/{src/inspectors → inspectors}/utils/SvgDimensionShower.d.ts +0 -0
- /package/dist/{src/random.d.ts → random.d.ts} +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{test/generateMockData.spec.d.ts → types.js} +0 -0
package/dist/src/types.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const generateMockData_1 = require("../src/generateMockData");
|
|
4
|
-
describe('generateMockData', () => {
|
|
5
|
-
test('should generate data with correct length', () => {
|
|
6
|
-
const data = (0, generateMockData_1.generateMockData)(10, 123);
|
|
7
|
-
expect(data).toHaveLength(10);
|
|
8
|
-
});
|
|
9
|
-
test('should be deterministic with same seed', () => {
|
|
10
|
-
const data1 = (0, generateMockData_1.generateMockData)(5, 456);
|
|
11
|
-
const data2 = (0, generateMockData_1.generateMockData)(5, 456);
|
|
12
|
-
expect(data1).toEqual(data2);
|
|
13
|
-
});
|
|
14
|
-
test('should generate different data with different seeds', () => {
|
|
15
|
-
const data1 = (0, generateMockData_1.generateMockData)(5, 456);
|
|
16
|
-
const data2 = (0, generateMockData_1.generateMockData)(5, 789);
|
|
17
|
-
expect(data1).not.toEqual(data2);
|
|
18
|
-
});
|
|
19
|
-
test('should have expected structure', () => {
|
|
20
|
-
const data = (0, generateMockData_1.generateMockData)(1, 100);
|
|
21
|
-
const item = data[0];
|
|
22
|
-
expect(item).toHaveProperty('label');
|
|
23
|
-
expect(item).toHaveProperty('x');
|
|
24
|
-
expect(item).toHaveProperty('y');
|
|
25
|
-
expect(item).toHaveProperty('z');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/test/random.spec.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const random_1 = require("../src/random");
|
|
4
|
-
describe('random', () => {
|
|
5
|
-
test.each([
|
|
6
|
-
[0.1, 7574, 43828, 10324, 53467, 12342, 8206, 25691, 26326, 8414, 41291],
|
|
7
|
-
[0.2, 15074, 16495, 57533, 55144, 7043, 4003, 38151, 43308, 36861, 12095],
|
|
8
|
-
[0.3, 22574, 54699, 39205, 56821, 1744, 65337, 50611, 60290, 65308, 48436],
|
|
9
|
-
[0, 74, 5624, 28652, 51790, 17641, 12409, 13231, 9344, 45504, 4950],
|
|
10
|
-
[-5, 65236, 43036, 16461, 54983, 60505, 15896, 12608, 28156, 14590, 45732],
|
|
11
|
-
])('should provide pseudorandom numbers for seed %d', (seed, ...numbers) => {
|
|
12
|
-
const gen = (0, random_1.random)(seed);
|
|
13
|
-
numbers.forEach(n => {
|
|
14
|
-
expect(gen.next().value).toBe(n);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe('between', () => {
|
|
19
|
-
test.each([
|
|
20
|
-
[100, 5, 10, 5],
|
|
21
|
-
[100, 5, 17, 9],
|
|
22
|
-
[101, 5, 17, 10],
|
|
23
|
-
])('should take a generator %d and boundaries <%d, %d> and return %d', (value, min, max, expected) => {
|
|
24
|
-
function* gen() {
|
|
25
|
-
yield value;
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
expect((0, random_1.between)(gen(), min, max)).toBe(expected);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|