victory-core 37.1.1 → 37.2.0
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/CHANGELOG.md +18 -0
- package/dist/victory-core.js +608 -41
- package/dist/victory-core.min.js +1 -1
- package/es/types/prop-types.d.ts +1 -0
- package/es/victory-portal/victory-portal.js +2 -1
- package/es/victory-theme/clean.d.ts +3 -0
- package/es/victory-theme/clean.js +457 -0
- package/es/victory-theme/grayscale.js +36 -6
- package/es/victory-theme/material.js +36 -5
- package/es/victory-theme/types.d.ts +17 -0
- package/es/victory-theme/victory-theme.d.ts +1 -0
- package/es/victory-theme/victory-theme.js +3 -1
- package/es/victory-util/style.d.ts +3 -1
- package/es/victory-util/style.js +29 -10
- package/es/victory-util/textsize.js +5 -0
- package/es/victory-util/wrapper.d.ts +2 -2
- package/es/victory-util/wrapper.js +8 -4
- package/lib/types/prop-types.d.ts +1 -0
- package/lib/victory-portal/victory-portal.js +2 -1
- package/lib/victory-theme/clean.d.ts +3 -0
- package/lib/victory-theme/clean.js +463 -0
- package/lib/victory-theme/grayscale.js +36 -6
- package/lib/victory-theme/material.js +36 -5
- package/lib/victory-theme/types.d.ts +17 -0
- package/lib/victory-theme/victory-theme.d.ts +1 -0
- package/lib/victory-theme/victory-theme.js +3 -1
- package/lib/victory-util/style.d.ts +3 -1
- package/lib/victory-util/style.js +28 -10
- package/lib/victory-util/textsize.js +5 -0
- package/lib/victory-util/wrapper.d.ts +2 -2
- package/lib/victory-util/wrapper.js +8 -4
- package/package.json +2 -2
- package/src/types/prop-types.ts +1 -0
- package/src/victory-portal/victory-portal.tsx +2 -2
- package/src/victory-theme/clean.tsx +448 -0
- package/src/victory-theme/grayscale.tsx +49 -6
- package/src/victory-theme/material.tsx +50 -6
- package/src/victory-theme/types.ts +27 -0
- package/src/victory-theme/victory-theme.tsx +3 -1
- package/src/victory-util/style.ts +37 -22
- package/src/victory-util/textsize.ts +5 -0
- package/src/victory-util/wrapper.tsx +8 -4
package/dist/victory-core.js
CHANGED
|
@@ -1410,31 +1410,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1410
1410
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1411
1411
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
1412
1412
|
/* harmony export */ });
|
|
1413
|
-
/* harmony import */ var
|
|
1414
|
-
/* harmony import */ var
|
|
1415
|
-
/* harmony import */ var
|
|
1416
|
-
/* harmony import */ var
|
|
1417
|
-
/* harmony import */ var
|
|
1418
|
-
/* harmony import */ var
|
|
1419
|
-
/* harmony import */ var
|
|
1413
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
1414
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
1415
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
1416
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
1417
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
1418
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
1419
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "./victory-util/log.ts");
|
|
1420
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "./victory-util/helpers.ts");
|
|
1421
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "./victory-portal/portal-context.tsx");
|
|
1422
|
+
|
|
1420
1423
|
|
|
1421
1424
|
|
|
1422
1425
|
|
|
1423
1426
|
|
|
1424
1427
|
|
|
1425
1428
|
const defaultProps = {
|
|
1426
|
-
groupComponent: /*#__PURE__*/
|
|
1429
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
1427
1430
|
};
|
|
1428
1431
|
const VictoryPortal = initialProps => {
|
|
1429
1432
|
const props = {
|
|
1430
1433
|
...defaultProps,
|
|
1431
1434
|
...initialProps
|
|
1432
1435
|
};
|
|
1433
|
-
const id =
|
|
1434
|
-
const portalContext = (0,
|
|
1436
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
1437
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
1435
1438
|
if (!portalContext) {
|
|
1436
1439
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
1437
|
-
|
|
1440
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
1438
1441
|
}
|
|
1439
1442
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
1440
1443
|
const {
|
|
@@ -1445,15 +1448,15 @@ const VictoryPortal = initialProps => {
|
|
|
1445
1448
|
groupComponent,
|
|
1446
1449
|
standalone: false
|
|
1447
1450
|
} : {};
|
|
1448
|
-
const newProps =
|
|
1451
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
1449
1452
|
key: childProps.key ?? id
|
|
1450
1453
|
});
|
|
1451
|
-
const child = children && /*#__PURE__*/
|
|
1452
|
-
|
|
1454
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
1455
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
1453
1456
|
portalContext?.addChild(id, child);
|
|
1454
1457
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1455
1458
|
}, [props.children]);
|
|
1456
|
-
|
|
1459
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
1457
1460
|
return () => portalContext?.removeChild(id);
|
|
1458
1461
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1459
1462
|
}, []);
|
|
@@ -2272,6 +2275,477 @@ const Whisker = initialProps => {
|
|
|
2272
2275
|
|
|
2273
2276
|
/***/ }),
|
|
2274
2277
|
|
|
2278
|
+
/***/ "./victory-theme/clean.tsx":
|
|
2279
|
+
/*!*********************************!*\
|
|
2280
|
+
!*** ./victory-theme/clean.tsx ***!
|
|
2281
|
+
\*********************************/
|
|
2282
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2283
|
+
|
|
2284
|
+
"use strict";
|
|
2285
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2286
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2287
|
+
/* harmony export */ "clean": function() { return /* binding */ clean; }
|
|
2288
|
+
/* harmony export */ });
|
|
2289
|
+
// *
|
|
2290
|
+
// * Colors
|
|
2291
|
+
// *
|
|
2292
|
+
|
|
2293
|
+
const gray = {
|
|
2294
|
+
white: "#FFFFFF",
|
|
2295
|
+
"50": "#FAFAFA",
|
|
2296
|
+
"100": "#F2F2F2",
|
|
2297
|
+
"200": "#E8E8E8",
|
|
2298
|
+
"300": "#E0E0E0",
|
|
2299
|
+
"400": "#D1D1D1",
|
|
2300
|
+
"500": "#757575",
|
|
2301
|
+
"600": "#5C5C5C",
|
|
2302
|
+
"700": "#424242",
|
|
2303
|
+
"800": "#333333",
|
|
2304
|
+
"900": "#292929",
|
|
2305
|
+
black: "#0F0F0F"
|
|
2306
|
+
};
|
|
2307
|
+
const yellow = {
|
|
2308
|
+
"100": "#FFEAB6",
|
|
2309
|
+
"300": "#FFD66E",
|
|
2310
|
+
"500": "#FCB400",
|
|
2311
|
+
"900": "#B87503"
|
|
2312
|
+
};
|
|
2313
|
+
const orange = {
|
|
2314
|
+
"100": "#FEE2D5",
|
|
2315
|
+
"300": "#FFA981",
|
|
2316
|
+
"500": "#FF6F2C",
|
|
2317
|
+
"900": "#D74D26"
|
|
2318
|
+
};
|
|
2319
|
+
const red = {
|
|
2320
|
+
"100": "#FFDCE5",
|
|
2321
|
+
"300": "#FF9EB7",
|
|
2322
|
+
"500": "#F82B60",
|
|
2323
|
+
"900": "#BA1E45"
|
|
2324
|
+
};
|
|
2325
|
+
const pink = {
|
|
2326
|
+
"100": "#FFDAF6",
|
|
2327
|
+
"300": "#F99DE2",
|
|
2328
|
+
"500": "#FF08C2",
|
|
2329
|
+
"900": "#B2158B"
|
|
2330
|
+
};
|
|
2331
|
+
const purple = {
|
|
2332
|
+
"100": "#EDE3FE",
|
|
2333
|
+
"300": "#CDB0FF",
|
|
2334
|
+
"500": "#8B46FF",
|
|
2335
|
+
"900": "#6B1CB0"
|
|
2336
|
+
};
|
|
2337
|
+
const blue = {
|
|
2338
|
+
"100": "#CFDFFF",
|
|
2339
|
+
"300": "#9CC7FF",
|
|
2340
|
+
"500": "#2D7FF9",
|
|
2341
|
+
"900": "#2750AE"
|
|
2342
|
+
};
|
|
2343
|
+
const cyan = {
|
|
2344
|
+
"100": "#D0F0FD",
|
|
2345
|
+
"300": "#77D1F3",
|
|
2346
|
+
"500": "#18BFFF",
|
|
2347
|
+
"900": "#0B76B7"
|
|
2348
|
+
};
|
|
2349
|
+
const teal = {
|
|
2350
|
+
"100": "#C2F5E9",
|
|
2351
|
+
"300": "#72DDC3",
|
|
2352
|
+
"500": "#20D9D2",
|
|
2353
|
+
"900": "#06A09B"
|
|
2354
|
+
};
|
|
2355
|
+
const green = {
|
|
2356
|
+
"100": "#D1F7C4",
|
|
2357
|
+
"300": "#93E088",
|
|
2358
|
+
"500": "#20C933",
|
|
2359
|
+
"900": "#338A17"
|
|
2360
|
+
};
|
|
2361
|
+
const colors = {
|
|
2362
|
+
blue: blue["500"],
|
|
2363
|
+
pink: pink["500"],
|
|
2364
|
+
teal: teal["500"],
|
|
2365
|
+
purple: purple["500"],
|
|
2366
|
+
green: green["500"],
|
|
2367
|
+
orange: orange["500"],
|
|
2368
|
+
cyan: cyan["500"],
|
|
2369
|
+
red: red["500"],
|
|
2370
|
+
yellow: yellow["500"]
|
|
2371
|
+
};
|
|
2372
|
+
const colorScale = Object.values(colors);
|
|
2373
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
2374
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
2375
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
2376
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
2377
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
2378
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
2379
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
2380
|
+
|
|
2381
|
+
// *
|
|
2382
|
+
// * Typography
|
|
2383
|
+
// *
|
|
2384
|
+
const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
|
|
2385
|
+
const letterSpacing = "normal";
|
|
2386
|
+
const fontSize = 12;
|
|
2387
|
+
// *
|
|
2388
|
+
// * Layout
|
|
2389
|
+
// *
|
|
2390
|
+
const padding = 8;
|
|
2391
|
+
const baseProps = {
|
|
2392
|
+
width: 450,
|
|
2393
|
+
height: 300,
|
|
2394
|
+
padding: 50,
|
|
2395
|
+
colorScale
|
|
2396
|
+
};
|
|
2397
|
+
// *
|
|
2398
|
+
// * Labels
|
|
2399
|
+
// *
|
|
2400
|
+
const baseLabelStyles = {
|
|
2401
|
+
fontFamily: sansSerif,
|
|
2402
|
+
fontSize,
|
|
2403
|
+
fontWeight: 300,
|
|
2404
|
+
letterSpacing,
|
|
2405
|
+
padding,
|
|
2406
|
+
fill: gray["900"],
|
|
2407
|
+
stroke: "transparent"
|
|
2408
|
+
};
|
|
2409
|
+
const centeredLabelStyles = Object.assign({
|
|
2410
|
+
textAnchor: "middle"
|
|
2411
|
+
}, baseLabelStyles);
|
|
2412
|
+
|
|
2413
|
+
// *
|
|
2414
|
+
// * Strokes
|
|
2415
|
+
// *
|
|
2416
|
+
const strokeDasharray = "10, 5";
|
|
2417
|
+
const strokeLinecap = "round";
|
|
2418
|
+
const strokeLinejoin = "round";
|
|
2419
|
+
const borderRadius = 1;
|
|
2420
|
+
// *
|
|
2421
|
+
// * Theme
|
|
2422
|
+
// *
|
|
2423
|
+
const clean = {
|
|
2424
|
+
palette: {
|
|
2425
|
+
colors,
|
|
2426
|
+
grayscale,
|
|
2427
|
+
qualitative: colorScale,
|
|
2428
|
+
heatmap,
|
|
2429
|
+
warm,
|
|
2430
|
+
cool,
|
|
2431
|
+
red: redPalette,
|
|
2432
|
+
green: greenPalette,
|
|
2433
|
+
blue: bluePalette
|
|
2434
|
+
},
|
|
2435
|
+
area: Object.assign({
|
|
2436
|
+
style: {
|
|
2437
|
+
data: {
|
|
2438
|
+
fill: blue["500"],
|
|
2439
|
+
strokeWidth: 2,
|
|
2440
|
+
fillOpacity: 0.5
|
|
2441
|
+
},
|
|
2442
|
+
labels: baseLabelStyles
|
|
2443
|
+
}
|
|
2444
|
+
}, baseProps),
|
|
2445
|
+
axis: Object.assign({
|
|
2446
|
+
style: {
|
|
2447
|
+
axis: {
|
|
2448
|
+
fill: "transparent",
|
|
2449
|
+
stroke: gray["500"],
|
|
2450
|
+
strokeWidth: 1,
|
|
2451
|
+
strokeLinecap,
|
|
2452
|
+
strokeLinejoin
|
|
2453
|
+
},
|
|
2454
|
+
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
2455
|
+
padding,
|
|
2456
|
+
stroke: "transparent"
|
|
2457
|
+
}),
|
|
2458
|
+
grid: {
|
|
2459
|
+
fill: "none",
|
|
2460
|
+
stroke: "none",
|
|
2461
|
+
painterEvents: "painted"
|
|
2462
|
+
},
|
|
2463
|
+
ticks: {
|
|
2464
|
+
fill: "transparent",
|
|
2465
|
+
size: 5,
|
|
2466
|
+
stroke: "transparent"
|
|
2467
|
+
},
|
|
2468
|
+
tickLabels: baseLabelStyles
|
|
2469
|
+
}
|
|
2470
|
+
}, baseProps),
|
|
2471
|
+
polarAxis: Object.assign({
|
|
2472
|
+
style: {
|
|
2473
|
+
axis: {
|
|
2474
|
+
stroke: gray["500"]
|
|
2475
|
+
},
|
|
2476
|
+
grid: {
|
|
2477
|
+
stroke: gray["400"],
|
|
2478
|
+
strokeDasharray,
|
|
2479
|
+
strokeLinecap,
|
|
2480
|
+
strokeLinejoin,
|
|
2481
|
+
pointerEvents: "painted"
|
|
2482
|
+
},
|
|
2483
|
+
ticks: {
|
|
2484
|
+
fill: "transparent",
|
|
2485
|
+
size: 5,
|
|
2486
|
+
stroke: gray["400"],
|
|
2487
|
+
strokeWidth: 1,
|
|
2488
|
+
strokeLinecap,
|
|
2489
|
+
strokeLinejoin
|
|
2490
|
+
},
|
|
2491
|
+
tickLabels: baseLabelStyles
|
|
2492
|
+
}
|
|
2493
|
+
}),
|
|
2494
|
+
polarDependentAxis: Object.assign({
|
|
2495
|
+
style: {
|
|
2496
|
+
axis: {
|
|
2497
|
+
stroke: gray["500"]
|
|
2498
|
+
},
|
|
2499
|
+
grid: {
|
|
2500
|
+
stroke: gray["400"],
|
|
2501
|
+
strokeDasharray,
|
|
2502
|
+
strokeLinecap,
|
|
2503
|
+
strokeLinejoin,
|
|
2504
|
+
pointerEvents: "painted"
|
|
2505
|
+
},
|
|
2506
|
+
ticks: {
|
|
2507
|
+
fill: "transparent",
|
|
2508
|
+
size: 5,
|
|
2509
|
+
stroke: gray["300"],
|
|
2510
|
+
strokeWidth: 1,
|
|
2511
|
+
strokeLinecap,
|
|
2512
|
+
strokeLinejoin
|
|
2513
|
+
},
|
|
2514
|
+
tickLabels: baseLabelStyles
|
|
2515
|
+
}
|
|
2516
|
+
}),
|
|
2517
|
+
bar: Object.assign({
|
|
2518
|
+
style: {
|
|
2519
|
+
data: {
|
|
2520
|
+
fill: blue["500"],
|
|
2521
|
+
padding,
|
|
2522
|
+
strokeWidth: 1,
|
|
2523
|
+
fillOpacity: 0.5
|
|
2524
|
+
},
|
|
2525
|
+
labels: baseLabelStyles
|
|
2526
|
+
},
|
|
2527
|
+
cornerRadius: {
|
|
2528
|
+
top: borderRadius
|
|
2529
|
+
}
|
|
2530
|
+
}, baseProps),
|
|
2531
|
+
boxplot: Object.assign({
|
|
2532
|
+
style: {
|
|
2533
|
+
max: {
|
|
2534
|
+
padding,
|
|
2535
|
+
stroke: gray["400"],
|
|
2536
|
+
strokeWidth: 2
|
|
2537
|
+
},
|
|
2538
|
+
maxLabels: Object.assign({}, baseLabelStyles, {
|
|
2539
|
+
padding: 3
|
|
2540
|
+
}),
|
|
2541
|
+
median: {
|
|
2542
|
+
padding,
|
|
2543
|
+
stroke: gray.white,
|
|
2544
|
+
strokeWidth: 2
|
|
2545
|
+
},
|
|
2546
|
+
medianLabels: Object.assign({}, baseLabelStyles, {
|
|
2547
|
+
padding: 3
|
|
2548
|
+
}),
|
|
2549
|
+
min: {
|
|
2550
|
+
padding,
|
|
2551
|
+
stroke: gray["400"],
|
|
2552
|
+
strokeWidth: 2
|
|
2553
|
+
},
|
|
2554
|
+
minLabels: Object.assign({}, baseLabelStyles, {
|
|
2555
|
+
padding: 3
|
|
2556
|
+
}),
|
|
2557
|
+
q1: {
|
|
2558
|
+
padding,
|
|
2559
|
+
fill: teal["500"],
|
|
2560
|
+
rx: borderRadius,
|
|
2561
|
+
strokeWidth: 2
|
|
2562
|
+
},
|
|
2563
|
+
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
2564
|
+
padding: 3
|
|
2565
|
+
}),
|
|
2566
|
+
q3: {
|
|
2567
|
+
padding,
|
|
2568
|
+
fill: cyan["500"],
|
|
2569
|
+
rx: borderRadius
|
|
2570
|
+
},
|
|
2571
|
+
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
2572
|
+
padding: 3
|
|
2573
|
+
})
|
|
2574
|
+
},
|
|
2575
|
+
boxWidth: 20
|
|
2576
|
+
}, baseProps),
|
|
2577
|
+
candlestick: Object.assign({
|
|
2578
|
+
style: {
|
|
2579
|
+
data: {
|
|
2580
|
+
stroke: gray["300"],
|
|
2581
|
+
strokeWidth: 0,
|
|
2582
|
+
rx: borderRadius
|
|
2583
|
+
},
|
|
2584
|
+
labels: Object.assign({}, baseLabelStyles, {
|
|
2585
|
+
padding: 5
|
|
2586
|
+
})
|
|
2587
|
+
},
|
|
2588
|
+
candleColors: {
|
|
2589
|
+
positive: teal["500"],
|
|
2590
|
+
negative: orange["500"]
|
|
2591
|
+
},
|
|
2592
|
+
wickStrokeWidth: 2
|
|
2593
|
+
}, baseProps),
|
|
2594
|
+
chart: baseProps,
|
|
2595
|
+
errorbar: Object.assign({
|
|
2596
|
+
borderWidth: 8,
|
|
2597
|
+
style: {
|
|
2598
|
+
data: {
|
|
2599
|
+
fill: "transparent",
|
|
2600
|
+
opacity: 1,
|
|
2601
|
+
stroke: gray["700"],
|
|
2602
|
+
strokeWidth: 2,
|
|
2603
|
+
strokeLinecap
|
|
2604
|
+
},
|
|
2605
|
+
labels: baseLabelStyles
|
|
2606
|
+
}
|
|
2607
|
+
}, baseProps),
|
|
2608
|
+
group: Object.assign({
|
|
2609
|
+
colorScale
|
|
2610
|
+
}, baseProps),
|
|
2611
|
+
histogram: Object.assign({
|
|
2612
|
+
style: {
|
|
2613
|
+
data: {
|
|
2614
|
+
fill: cyan["500"],
|
|
2615
|
+
fillOpacity: 0.5
|
|
2616
|
+
},
|
|
2617
|
+
labels: baseLabelStyles
|
|
2618
|
+
},
|
|
2619
|
+
binSpacing: 4,
|
|
2620
|
+
cornerRadius: {
|
|
2621
|
+
top: borderRadius
|
|
2622
|
+
}
|
|
2623
|
+
}, baseProps),
|
|
2624
|
+
label: baseLabelStyles,
|
|
2625
|
+
legend: {
|
|
2626
|
+
colorScale,
|
|
2627
|
+
gutter: 24,
|
|
2628
|
+
borderPadding: 10,
|
|
2629
|
+
orientation: "horizontal",
|
|
2630
|
+
titleOrientation: "top",
|
|
2631
|
+
centerTitle: true,
|
|
2632
|
+
style: {
|
|
2633
|
+
data: {
|
|
2634
|
+
type: "circle"
|
|
2635
|
+
},
|
|
2636
|
+
labels: {
|
|
2637
|
+
...baseLabelStyles,
|
|
2638
|
+
fontSize: 12
|
|
2639
|
+
},
|
|
2640
|
+
title: Object.assign({}, baseLabelStyles, {
|
|
2641
|
+
padding,
|
|
2642
|
+
fontSize: 16
|
|
2643
|
+
}),
|
|
2644
|
+
border: {
|
|
2645
|
+
stroke: gray["200"],
|
|
2646
|
+
strokeWidth: 2,
|
|
2647
|
+
padding: 16
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
},
|
|
2651
|
+
line: Object.assign({
|
|
2652
|
+
style: {
|
|
2653
|
+
data: {
|
|
2654
|
+
fill: "transparent",
|
|
2655
|
+
opacity: 1,
|
|
2656
|
+
stroke: blue["500"],
|
|
2657
|
+
strokeWidth: 2,
|
|
2658
|
+
strokeLinecap,
|
|
2659
|
+
strokeLinejoin
|
|
2660
|
+
},
|
|
2661
|
+
labels: baseLabelStyles
|
|
2662
|
+
}
|
|
2663
|
+
}, baseProps),
|
|
2664
|
+
pie: Object.assign({
|
|
2665
|
+
style: {
|
|
2666
|
+
parent: {
|
|
2667
|
+
backgroundColor: gray.white
|
|
2668
|
+
},
|
|
2669
|
+
data: {
|
|
2670
|
+
padding,
|
|
2671
|
+
stroke: gray.white,
|
|
2672
|
+
strokeWidth: 1
|
|
2673
|
+
},
|
|
2674
|
+
labels: {
|
|
2675
|
+
...baseLabelStyles,
|
|
2676
|
+
padding: 20,
|
|
2677
|
+
fill: gray["600"],
|
|
2678
|
+
fontSize: 10
|
|
2679
|
+
}
|
|
2680
|
+
},
|
|
2681
|
+
colorScale,
|
|
2682
|
+
cornerRadius: borderRadius
|
|
2683
|
+
}, baseProps),
|
|
2684
|
+
scatter: Object.assign({
|
|
2685
|
+
style: {
|
|
2686
|
+
data: {
|
|
2687
|
+
fill: purple["500"],
|
|
2688
|
+
opacity: 1,
|
|
2689
|
+
stroke: "transparent",
|
|
2690
|
+
strokeWidth: 0
|
|
2691
|
+
},
|
|
2692
|
+
labels: {
|
|
2693
|
+
...baseLabelStyles,
|
|
2694
|
+
padding: 20
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
}, baseProps),
|
|
2698
|
+
stack: Object.assign({
|
|
2699
|
+
colorScale
|
|
2700
|
+
}, baseProps),
|
|
2701
|
+
tooltip: {
|
|
2702
|
+
style: Object.assign({}, baseLabelStyles, {
|
|
2703
|
+
padding: 0,
|
|
2704
|
+
pointerEvents: "none"
|
|
2705
|
+
}),
|
|
2706
|
+
flyoutStyle: {
|
|
2707
|
+
stroke: gray["300"],
|
|
2708
|
+
strokeWidth: 2,
|
|
2709
|
+
fill: gray.white,
|
|
2710
|
+
pointerEvents: "none"
|
|
2711
|
+
},
|
|
2712
|
+
flyoutPadding: {
|
|
2713
|
+
top: 8,
|
|
2714
|
+
bottom: 8,
|
|
2715
|
+
left: 16,
|
|
2716
|
+
right: 16
|
|
2717
|
+
},
|
|
2718
|
+
cornerRadius: borderRadius,
|
|
2719
|
+
pointerLength: 4
|
|
2720
|
+
},
|
|
2721
|
+
voronoi: Object.assign({
|
|
2722
|
+
style: {
|
|
2723
|
+
data: {
|
|
2724
|
+
fill: blue["100"],
|
|
2725
|
+
stroke: blue["500"],
|
|
2726
|
+
strokeWidth: 2,
|
|
2727
|
+
opacity: 0.4
|
|
2728
|
+
},
|
|
2729
|
+
labels: Object.assign({}, baseLabelStyles, {
|
|
2730
|
+
padding: 5,
|
|
2731
|
+
pointerEvents: "none"
|
|
2732
|
+
}),
|
|
2733
|
+
flyout: {
|
|
2734
|
+
stroke: gray["900"],
|
|
2735
|
+
strokeWidth: 1,
|
|
2736
|
+
fill: gray["100"],
|
|
2737
|
+
pointerEvents: "none"
|
|
2738
|
+
},
|
|
2739
|
+
padding: {
|
|
2740
|
+
left: 2,
|
|
2741
|
+
bottom: 2
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
}, baseProps)
|
|
2745
|
+
};
|
|
2746
|
+
|
|
2747
|
+
/***/ }),
|
|
2748
|
+
|
|
2275
2749
|
/***/ "./victory-theme/grayscale.tsx":
|
|
2276
2750
|
/*!*************************************!*\
|
|
2277
2751
|
!*** ./victory-theme/grayscale.tsx ***!
|
|
@@ -2286,9 +2760,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2286
2760
|
// *
|
|
2287
2761
|
// * Colors
|
|
2288
2762
|
// *
|
|
2289
|
-
const colors =
|
|
2763
|
+
const colors = {
|
|
2764
|
+
blue: "#4F7DA1",
|
|
2765
|
+
pink: "#E2A37F",
|
|
2766
|
+
teal: "#00796B",
|
|
2767
|
+
purple: "#DF948A",
|
|
2768
|
+
green: "#8BC34A",
|
|
2769
|
+
orange: "#F4511E",
|
|
2770
|
+
cyan: "#006064",
|
|
2771
|
+
red: "#DF5A49",
|
|
2772
|
+
yellow: "#FFF59D"
|
|
2773
|
+
};
|
|
2774
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
2290
2775
|
const charcoal = "#252525";
|
|
2291
2776
|
const grey = "#969696";
|
|
2777
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
2778
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
2779
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
2780
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
2781
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
2782
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
2783
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
2784
|
+
|
|
2292
2785
|
// *
|
|
2293
2786
|
// * Typography
|
|
2294
2787
|
// *
|
|
@@ -2302,7 +2795,7 @@ const baseProps = {
|
|
|
2302
2795
|
width: 450,
|
|
2303
2796
|
height: 300,
|
|
2304
2797
|
padding: 50,
|
|
2305
|
-
colorScale
|
|
2798
|
+
colorScale
|
|
2306
2799
|
};
|
|
2307
2800
|
// *
|
|
2308
2801
|
// * Labels
|
|
@@ -2324,6 +2817,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
2324
2817
|
const strokeLinecap = "round";
|
|
2325
2818
|
const strokeLinejoin = "round";
|
|
2326
2819
|
const grayscale = {
|
|
2820
|
+
palette: {
|
|
2821
|
+
colors,
|
|
2822
|
+
grayscale: colorScale,
|
|
2823
|
+
qualitative,
|
|
2824
|
+
heatmap,
|
|
2825
|
+
warm,
|
|
2826
|
+
cool,
|
|
2827
|
+
red,
|
|
2828
|
+
green,
|
|
2829
|
+
blue
|
|
2830
|
+
},
|
|
2327
2831
|
area: Object.assign({
|
|
2328
2832
|
style: {
|
|
2329
2833
|
data: {
|
|
@@ -2438,7 +2942,7 @@ const grayscale = {
|
|
|
2438
2942
|
}
|
|
2439
2943
|
}, baseProps),
|
|
2440
2944
|
group: Object.assign({
|
|
2441
|
-
colorScale
|
|
2945
|
+
colorScale
|
|
2442
2946
|
}, baseProps),
|
|
2443
2947
|
histogram: Object.assign({
|
|
2444
2948
|
style: {
|
|
@@ -2451,7 +2955,7 @@ const grayscale = {
|
|
|
2451
2955
|
}
|
|
2452
2956
|
}, baseProps),
|
|
2453
2957
|
legend: {
|
|
2454
|
-
colorScale
|
|
2958
|
+
colorScale,
|
|
2455
2959
|
gutter: 10,
|
|
2456
2960
|
orientation: "vertical",
|
|
2457
2961
|
titleOrientation: "top",
|
|
@@ -2486,7 +2990,7 @@ const grayscale = {
|
|
|
2486
2990
|
padding: 20
|
|
2487
2991
|
})
|
|
2488
2992
|
},
|
|
2489
|
-
colorScale
|
|
2993
|
+
colorScale,
|
|
2490
2994
|
width: 400,
|
|
2491
2995
|
height: 400,
|
|
2492
2996
|
padding: 50
|
|
@@ -2502,7 +3006,7 @@ const grayscale = {
|
|
|
2502
3006
|
}
|
|
2503
3007
|
}, baseProps),
|
|
2504
3008
|
stack: Object.assign({
|
|
2505
|
-
colorScale
|
|
3009
|
+
colorScale
|
|
2506
3010
|
}, baseProps),
|
|
2507
3011
|
tooltip: {
|
|
2508
3012
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -2562,11 +3066,31 @@ const lime300 = "#DCE775";
|
|
|
2562
3066
|
const lightGreen500 = "#8BC34A";
|
|
2563
3067
|
const teal700 = "#00796B";
|
|
2564
3068
|
const cyan900 = "#006064";
|
|
2565
|
-
const
|
|
3069
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
2566
3070
|
const blueGrey50 = "#ECEFF1";
|
|
2567
3071
|
const blueGrey300 = "#90A4AE";
|
|
2568
3072
|
const blueGrey700 = "#455A64";
|
|
2569
3073
|
const grey900 = "#212121";
|
|
3074
|
+
const colors = {
|
|
3075
|
+
blue: "#4F7DA1",
|
|
3076
|
+
pink: "#E2A37F",
|
|
3077
|
+
teal: teal700,
|
|
3078
|
+
purple: "#DF948A",
|
|
3079
|
+
green: lightGreen500,
|
|
3080
|
+
orange: deepOrange600,
|
|
3081
|
+
cyan: cyan900,
|
|
3082
|
+
red: "#DF5A49",
|
|
3083
|
+
yellow: yellow200
|
|
3084
|
+
};
|
|
3085
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
3086
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
3087
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
3088
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
3089
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
3090
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
3091
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
3092
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
3093
|
+
|
|
2570
3094
|
// *
|
|
2571
3095
|
// * Typography
|
|
2572
3096
|
// *
|
|
@@ -2604,6 +3128,17 @@ const strokeDasharray = "10, 5";
|
|
|
2604
3128
|
const strokeLinecap = "round";
|
|
2605
3129
|
const strokeLinejoin = "round";
|
|
2606
3130
|
const material = {
|
|
3131
|
+
palette: {
|
|
3132
|
+
colors,
|
|
3133
|
+
grayscale,
|
|
3134
|
+
qualitative,
|
|
3135
|
+
heatmap,
|
|
3136
|
+
warm,
|
|
3137
|
+
cool,
|
|
3138
|
+
red,
|
|
3139
|
+
green,
|
|
3140
|
+
blue
|
|
3141
|
+
},
|
|
2607
3142
|
area: Object.assign({
|
|
2608
3143
|
style: {
|
|
2609
3144
|
data: {
|
|
@@ -2736,7 +3271,7 @@ const material = {
|
|
|
2736
3271
|
}
|
|
2737
3272
|
}, baseProps),
|
|
2738
3273
|
group: Object.assign({
|
|
2739
|
-
colorScale
|
|
3274
|
+
colorScale
|
|
2740
3275
|
}, baseProps),
|
|
2741
3276
|
histogram: Object.assign({
|
|
2742
3277
|
style: {
|
|
@@ -2749,7 +3284,7 @@ const material = {
|
|
|
2749
3284
|
}
|
|
2750
3285
|
}, baseProps),
|
|
2751
3286
|
legend: {
|
|
2752
|
-
colorScale
|
|
3287
|
+
colorScale,
|
|
2753
3288
|
gutter: 10,
|
|
2754
3289
|
orientation: "vertical",
|
|
2755
3290
|
titleOrientation: "top",
|
|
@@ -2775,7 +3310,7 @@ const material = {
|
|
|
2775
3310
|
}
|
|
2776
3311
|
}, baseProps),
|
|
2777
3312
|
pie: Object.assign({
|
|
2778
|
-
colorScale
|
|
3313
|
+
colorScale,
|
|
2779
3314
|
style: {
|
|
2780
3315
|
data: {
|
|
2781
3316
|
padding,
|
|
@@ -2799,7 +3334,7 @@ const material = {
|
|
|
2799
3334
|
}
|
|
2800
3335
|
}, baseProps),
|
|
2801
3336
|
stack: Object.assign({
|
|
2802
|
-
colorScale
|
|
3337
|
+
colorScale
|
|
2803
3338
|
}, baseProps),
|
|
2804
3339
|
tooltip: {
|
|
2805
3340
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -2852,12 +3387,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2852
3387
|
/* harmony export */ });
|
|
2853
3388
|
/* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "./victory-theme/grayscale.tsx");
|
|
2854
3389
|
/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "./victory-theme/material.tsx");
|
|
3390
|
+
/* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "./victory-theme/clean.tsx");
|
|
3391
|
+
|
|
2855
3392
|
|
|
2856
3393
|
|
|
2857
3394
|
|
|
2858
3395
|
const VictoryTheme = {
|
|
2859
3396
|
grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
|
|
2860
|
-
material: _material__WEBPACK_IMPORTED_MODULE_1__.material
|
|
3397
|
+
material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
|
|
3398
|
+
clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
|
|
2861
3399
|
};
|
|
2862
3400
|
|
|
2863
3401
|
/***/ }),
|
|
@@ -6744,6 +7282,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6744
7282
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
6745
7283
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
6746
7284
|
/* harmony export */ });
|
|
7285
|
+
/* harmony import */ var _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../victory-theme/victory-theme */ "./victory-theme/victory-theme.tsx");
|
|
7286
|
+
|
|
7287
|
+
|
|
6747
7288
|
/**
|
|
6748
7289
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
6749
7290
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -6780,20 +7321,37 @@ const toTransformString = function (obj) {
|
|
|
6780
7321
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
6781
7322
|
* is given, it will return the Victory default grayscale.
|
|
6782
7323
|
* @param {String} name The name of the color scale to return (optional).
|
|
7324
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
6783
7325
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
6784
7326
|
*/
|
|
6785
|
-
function getColorScale(name) {
|
|
7327
|
+
function getColorScale(name, theme) {
|
|
7328
|
+
if (theme === void 0) {
|
|
7329
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
7330
|
+
}
|
|
7331
|
+
const {
|
|
7332
|
+
palette: {
|
|
7333
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
7334
|
+
qualitative = [],
|
|
7335
|
+
heatmap = [],
|
|
7336
|
+
warm = [],
|
|
7337
|
+
cool = [],
|
|
7338
|
+
red = [],
|
|
7339
|
+
blue = [],
|
|
7340
|
+
green = []
|
|
7341
|
+
} = {}
|
|
7342
|
+
} = theme;
|
|
6786
7343
|
const scales = {
|
|
6787
|
-
grayscale
|
|
6788
|
-
qualitative
|
|
6789
|
-
heatmap
|
|
6790
|
-
warm
|
|
6791
|
-
cool
|
|
6792
|
-
red
|
|
6793
|
-
blue
|
|
6794
|
-
green
|
|
7344
|
+
grayscale,
|
|
7345
|
+
qualitative,
|
|
7346
|
+
heatmap,
|
|
7347
|
+
warm,
|
|
7348
|
+
cool,
|
|
7349
|
+
red,
|
|
7350
|
+
blue,
|
|
7351
|
+
green
|
|
6795
7352
|
};
|
|
6796
|
-
|
|
7353
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
7354
|
+
return selectedScale;
|
|
6797
7355
|
}
|
|
6798
7356
|
|
|
6799
7357
|
/***/ }),
|
|
@@ -6820,6 +7378,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6820
7378
|
/* eslint-disable no-magic-numbers */
|
|
6821
7379
|
// Based on measuring specific character widths
|
|
6822
7380
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
7381
|
+
// For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
|
|
6823
7382
|
// prettier-ignore
|
|
6824
7383
|
const fonts = {
|
|
6825
7384
|
"American Typewriter": {
|
|
@@ -6878,6 +7437,10 @@ const fonts = {
|
|
|
6878
7437
|
widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
|
|
6879
7438
|
avg: 0.5116447368421051
|
|
6880
7439
|
},
|
|
7440
|
+
"Inter": {
|
|
7441
|
+
widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2890625, 0.4671875, 0.634375, 0.6421875, 0.9828125, 0.6453125, 0.3, 0.365625, 0.365625, 0.5015625, 0.6625, 0.2890625, 0.4609375, 0.2890625, 0.3609375, 0.63125, 0.4078125, 0.6109375, 0.61875, 0.646875, 0.59375, 0.6203125, 0.5671875, 0.61875, 0.6203125, 0.2890625, 0.303125, 0.6625, 0.6625, 0.6625, 0.5125, 0.9671875, 0.690625, 0.6546875, 0.73125, 0.721875, 0.6015625, 0.590625, 0.746875, 0.74375, 0.26875, 0.571875, 0.671875, 0.565625, 0.9046875, 0.7546875, 0.765625, 0.6390625, 0.765625, 0.64375, 0.6421875, 0.646875, 0.7453125, 0.690625, 0.9859375, 0.6828125, 0.6796875, 0.6296875, 0.365625, 0.3609375, 0.365625, 0.471875, 0.45625, 0.3234375, 0.5625, 0.6125, 0.571875, 0.6125, 0.584375, 0.3703125, 0.6140625, 0.5921875, 0.2421875, 0.2548828125, 0.55, 0.2421875, 0.8765625, 0.5921875, 0.6, 0.6125, 0.6125, 0.3765625, 0.528125, 0.328125, 0.5921875, 0.5625, 0.81875, 0.546875, 0.5625, 0.553125, 0.4265625, 0.3328125, 0.4265625, 0.6625],
|
|
7442
|
+
avg: 0.5624362664473683
|
|
7443
|
+
},
|
|
6881
7444
|
"Montserrat": {
|
|
6882
7445
|
widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
|
|
6883
7446
|
avg: 0.571792763157895
|
|
@@ -8030,7 +8593,9 @@ function getAllEvents(props) {
|
|
|
8030
8593
|
}
|
|
8031
8594
|
return events || [];
|
|
8032
8595
|
}
|
|
8033
|
-
|
|
8596
|
+
|
|
8597
|
+
// eslint-disable-next-line max-params
|
|
8598
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
8034
8599
|
// check for styles first
|
|
8035
8600
|
const {
|
|
8036
8601
|
style
|
|
@@ -8047,14 +8612,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
8047
8612
|
if (!colorScale && !color) {
|
|
8048
8613
|
return undefined;
|
|
8049
8614
|
}
|
|
8050
|
-
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
|
|
8615
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
|
|
8051
8616
|
return color || colors[index % colors.length];
|
|
8052
8617
|
}
|
|
8053
8618
|
function getStyle(theme, style, role) {
|
|
8054
8619
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
8055
8620
|
return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
|
|
8056
8621
|
}
|
|
8057
|
-
|
|
8622
|
+
|
|
8623
|
+
// eslint-disable-next-line max-params
|
|
8624
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
8058
8625
|
const {
|
|
8059
8626
|
style,
|
|
8060
8627
|
role
|
|
@@ -8064,7 +8631,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
8064
8631
|
return childStyle;
|
|
8065
8632
|
}
|
|
8066
8633
|
const childRole = child.type && child.type.role;
|
|
8067
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
8634
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
8068
8635
|
const defaultColor = childRole === "line" ? {
|
|
8069
8636
|
fill: "none",
|
|
8070
8637
|
stroke: defaultFill
|