-
Notifications
You must be signed in to change notification settings - Fork 23
[Fix-497]-head collisions comparison #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
05587dc
97303d8
43824c3
1a023fe
7535730
b175e2b
3251398
aec90e5
93c696c
4055049
e38b356
6fad676
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module.exports = { | ||
| stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
| addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-create-react-app'], | ||
| typescript: { | ||
| reactDocgen: 'react-docgen-typescript', | ||
| reactDocgenTypescriptOptions: { | ||
| compilerOptions: { | ||
| allowSyntheticDefaultImports: false, | ||
| esModuleInterop: false, | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <!-- Google alef font. see https://fonts.google.com/specimen/Alef --> | ||
| <link | ||
| href="https://fonts.googleapis.com/css2?family=Alef:wght@400;700&display=swap" | ||
| rel="stylesheet" | ||
| crossorigin="anonymous" | ||
| /> | ||
| <!-- Material icons. see: https://google.github.io/material-design-icons/ --> | ||
| <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" crossorigin="anonymous" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import React, { Suspense } from 'react'; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change to TS |
||
| import { Box, createStyles, makeStyles, createMuiTheme, ThemeProvider } from '@material-ui/core'; | ||
| import OverlayLoader from '../src/components/molecules/OverlayLoader'; | ||
| import { defaultThemeOptions } from '../src/style/theme'; | ||
|
|
||
| const customTheme = createMuiTheme(defaultThemeOptions); | ||
| const useStyles = makeStyles(() => | ||
| createStyles({ | ||
| rtl: { | ||
| direction: 'rtl', | ||
| }, | ||
| }), | ||
| ); | ||
|
|
||
| function StoryApp(Story) { | ||
| const classes = useStyles(); | ||
|
|
||
| return ( | ||
| <Suspense fallback={<OverlayLoader show />}> | ||
| <ThemeProvider theme={customTheme}> | ||
| <Box className={classes.rtl}> | ||
| <Story /> | ||
| </Box> | ||
| </ThemeProvider> | ||
| </Suspense> | ||
| ); | ||
| } | ||
| export const decorators = [StoryApp]; | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| import React from 'react'; | ||
| import { action } from '@storybook/addon-actions'; | ||
| import Button from './Button'; | ||
| export {}; | ||
| // import React from 'react'; | ||
| // import { action } from '@storybook/addon-actions'; | ||
|
||
| // import Button from './Button'; | ||
|
|
||
| export default { | ||
| title: 'Buttons', | ||
| }; | ||
| // export default { | ||
| // title: 'Buttons', | ||
| // }; | ||
|
|
||
| // export const ButtonPrimary = () => <Button.standard onClick={action('clicked')}>Button Primary</Button>; | ||
| // // export const ButtonPrimary = () => <Button.standard onClick={action('clicked')}>Button Primary</Button>; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,7 @@ export const PieChartView: FC<IProps> = ({ | |
| (props: PieLabelRenderProps) => labelProps.customizedLabel(props, labelProps.labelFontSize, true), | ||
| [labelProps], | ||
| ); | ||
|
|
||
| return ( | ||
| <ResponsiveContainer width={width} height={'100%'}> | ||
| <PieChart> | ||
|
|
@@ -125,9 +126,10 @@ export const PieChartView: FC<IProps> = ({ | |
| nameKey={xLabel} | ||
| innerRadius={innerRadius} | ||
| outerRadius={outerRadius} | ||
| minAngle={15} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yuvalbl - The size of the pie angles doesn't match the percentage it represents (for example the red 25% takes more than a quarter in the pie itself) |
||
| label={usePercent ? renderLabelPercent : renderLabelCount} | ||
| labelLine={false} | ||
| startAngle={-270} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yuvalbl - start pie from 12 o'clock instead of 15 |
||
| endAngle={360} | ||
|
||
| > | ||
| {data.map((entry: any, index: any) => ( | ||
| <Cell key={index} fill={COLORS[index % COLORS.length]} /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ const useStyles = makeStyles(() => ({ | |
| height: SECONDARY_CONTENT_HEIGHT, | ||
| width: '80%', | ||
| position: 'relative', | ||
| bottom: '25%', | ||
| bottom: '10%', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yuvalbl - The 25% in the large pie is hidden (see attached screenshot) |
||
| left: '5%', | ||
| fontSize: `${(PROPORTION * PRIMARY_FONT_SIZE).toString()} px`, | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import * as React from 'react'; | ||
| import HeadOnCollisionsComparisonWidget from '../HeadOnCollisionsComparisonWidget'; | ||
|
|
||
| export default { | ||
| title: 'Components/molecules/widgets/HeadOnCollisionsComparisonWidget', | ||
| }; | ||
|
|
||
| const data = { | ||
| items: { | ||
| specific_road_segment_fatal_accidents: [ | ||
| { desc: '\u05d7\u05d6\u05d9\u05ea\u05d9\u05d5\u05ea', count: 170 }, | ||
| { desc: '\u05d0\u05d7\u05e8\u05d5\u05ea', count: 150 }, | ||
| ], | ||
| all_roads_fatal_accidents: [ | ||
| { desc: '\u05d7\u05d6\u05d9\u05ea\u05d9\u05d5\u05ea', count: 178 }, | ||
| { desc: '\u05d0\u05d7\u05e8\u05d5\u05ea', count: 541 }, | ||
| ], | ||
| }, | ||
| text: { | ||
| title: | ||
| '\u05ea\u05d0\u05d5\u05e0\u05d5\u05ea \u05e7\u05d8\u05dc\u05e0\u05d9\u05d5\u05ea \u05e2\u05f4\u05e4 \u05e1\u05d5\u05d2', | ||
| }, | ||
| }; | ||
|
|
||
| export const common = () => <HeadOnCollisionsComparisonWidget data={data} segmetText="segmetText" />; | ||
|
|
||
| export const usePercent = () => <HeadOnCollisionsComparisonWidget data={data} segmetText="segmetText" usePercent />; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import * as React from 'react'; | ||
| import { Box } from '@material-ui/core'; | ||
| import makeStyles from '@material-ui/core/styles/makeStyles'; | ||
| import WidgetsTemplate from '../WidgetsTemplate'; | ||
|
|
||
| export default { | ||
| title: 'Components/organisms/WidgetsTemplate', | ||
| }; | ||
|
|
||
| const useStyles = makeStyles({ | ||
| mainBox: { | ||
| height: 'inherit', | ||
| }, | ||
|
|
||
| widgetBox: { | ||
| height: 'inherit', | ||
| overflow: 'auto', | ||
| }, | ||
| }); | ||
|
|
||
| const App: React.FC = () => { | ||
| const classes = useStyles(); | ||
|
|
||
| return ( | ||
| <Box display="flex" flexGrow={1} className={classes.mainBox}> | ||
| <Box flexGrow={5} className={classes.widgetBox} position="relative"> | ||
| <WidgetsTemplate /> | ||
| </Box> | ||
| </Box> | ||
| ); | ||
| }; | ||
|
|
||
| export const common = () => <App />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to TS