d3-funnel is an extensible, open-source JavaScript library for rendering - funnel charts using the D3.js library. + funnel charts using the D3.js library.

d3-funnel is focused on providing practical and visually appealing funnels through a variety diff --git a/examples/src/js/index.js b/examples/src/js/index.js index 53e5804..5488e42 100644 --- a/examples/src/js/index.js +++ b/examples/src/js/index.js @@ -74,23 +74,19 @@ const checkboxes = [...document.querySelectorAll('input')]; const color = document.querySelector('[value="color"]'); function onChange() { - let data = []; - - if (color.checked === false) { - data = [ + let data = !color.checked ? + [ { label: 'Applicants', value: 12000 }, { label: 'Pre-screened', value: 4000 }, { label: 'Interviewed', value: 2500 }, { label: 'Hired', value: 1500 }, - ]; - } else { - data = [ + ] : + [ { label: 'Teal', value: 12000, backgroundColor: '#008080' }, { label: 'Byzantium', value: 4000, backgroundColor: '#702963' }, { label: 'Persimmon', value: 2500, backgroundColor: '#ff634d' }, { label: 'Azure', value: 1500, backgroundColor: '#007fff' }, ]; - } let options = { chart: { diff --git a/webpack.config.js b/webpack.config.js index c7aec6e..c1ea7df 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ import path from 'node:path'; -import webpack from 'webpack'; import { readFile } from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; +import webpack from 'webpack'; const json = await readFile(new URL('./package.json', import.meta.url)); const pkg = JSON.parse(json.toString());