Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(website): improve typings of ComponentTemplate and use it at its…
… full potential for the heatmap
- Loading branch information
Showing
16 changed files
with
214 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,30 @@ | ||
import { generateCountriesData } from '@nivo/generators' | ||
import { generateXYSeries, sets } from '@nivo/generators' | ||
import { Data } from './types' | ||
|
||
const dishes = [ | ||
'hot dog', | ||
'burger', | ||
'sandwich', | ||
'kebab', | ||
'fries', | ||
'donut', | ||
'junk', | ||
'sushi', | ||
'ramen', | ||
'curry', | ||
'udon', | ||
'bagel', | ||
'yakitori', | ||
'takoyaki', | ||
'tacos', | ||
'miso soup', | ||
'tortilla', | ||
'tapas', | ||
'chipirones', | ||
'gazpacho', | ||
'soba', | ||
'bavette', | ||
'steak', | ||
'pizza', | ||
'spaghetti', | ||
'ravioli', | ||
'salad', | ||
'pad thai', | ||
'bun', | ||
'waffle', | ||
'crepe', | ||
'churros', | ||
'paella', | ||
'empanadas', | ||
'bruschetta', | ||
'onion soup', | ||
'cassoulet', | ||
'bouillabaisse', | ||
'unagi', | ||
'tempura', | ||
'tonkatsu', | ||
'shabu-shabu', | ||
'twinkies', | ||
'jerky', | ||
'fajitas', | ||
'jambalaya', | ||
'meatloaf', | ||
`mac n' cheese`, | ||
'baked beans', | ||
'popcorn', | ||
'buffalo wings', | ||
'BBQ ribs', | ||
'apple pie', | ||
'nachos', | ||
'risotto', | ||
'tiramisu', | ||
] | ||
export const getLightData = () => | ||
generateXYSeries({ | ||
serieIds: ['Japan', 'France', 'US', 'Germany', 'Norway', 'Iceland', 'UK', 'Vietnam'], | ||
x: { | ||
values: ['Train', 'Subway', 'Bus', 'Car', 'Boat', 'Moto', 'Moped', 'Bicycle', 'Others'], | ||
}, | ||
y: { | ||
length: NaN, | ||
min: -100_000, | ||
max: 100_000, | ||
round: true, | ||
}, | ||
}) as Data | ||
|
||
export const generateLightDataSet = () => ({ | ||
data: generateCountriesData(dishes.slice(0, 11), { size: 9, min: 0, max: 100 }), | ||
keys: dishes.slice(0, 11), | ||
}) | ||
|
||
export const generateHeavyDataSet = () => ({ | ||
data: generateCountriesData(dishes, { size: 22, min: 0, max: 100 }), | ||
keys: dishes, | ||
}) | ||
export const getHeavyData = () => | ||
generateXYSeries({ | ||
serieIds: sets.countryCodes.slice(0, 26), | ||
x: { | ||
values: sets.names, | ||
}, | ||
y: { | ||
length: NaN, | ||
min: -100_000, | ||
max: 100_000, | ||
round: true, | ||
}, | ||
}) as Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { settingsMapper, mapAxis, mapFormat } from '../../../lib/settings' | ||
import { SvgUnmappedProps, SvgMappedProps } from './types' | ||
|
||
export default settingsMapper( | ||
{ | ||
valueFormat: mapFormat, | ||
axisTop: mapAxis('top'), | ||
axisRight: mapAxis('right'), | ||
axisBottom: mapAxis('bottom'), | ||
axisLeft: mapAxis('left'), | ||
legends: (legends: SvgUnmappedProps['legends'][number][]): SvgMappedProps['legends'] => { | ||
return legends.map(legend => ({ | ||
...legend, | ||
tickFormat: mapFormat(legend.tickFormat), | ||
})) | ||
}, | ||
}, | ||
{ | ||
exclude: ['enable axisTop', 'enable axisRight', 'enable axisBottom', 'enable axisLeft'], | ||
} | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.