Skip to content

Commit

Permalink
Added Hull stories, and required victory-core package.
Browse files Browse the repository at this point in the history
  • Loading branch information
patcon committed Sep 23, 2024
1 parent 3dc491c commit 6507223
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 5 deletions.
218 changes: 215 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"author": "",
"license": "ISC",
"devDependencies": {
"jquery": "~2.1.4",
"@chromatic-com/storybook": "^1.9.0",
"@storybook/addon-essentials": "^8.3.2",
"@storybook/addon-interactions": "^8.3.2",
Expand All @@ -22,6 +21,7 @@
"@storybook/react": "^8.3.2",
"@storybook/react-webpack5": "^8.3.2",
"@storybook/test": "^8.3.2",
"jquery": "~2.1.4",
"prop-types": "^15.8.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
Expand All @@ -34,6 +34,7 @@
"color": "~4.2.3",
"radium": "^0.26.2",
"react-easy-emoji": "^1.8.1",
"theme-ui": "^0.3.5"
"theme-ui": "^0.3.5",
"victory-core": "~36.6.8"
}
}
34 changes: 34 additions & 0 deletions stories/client-participation/hull.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react'
import { action } from '@storybook/addon-actions'

import * as globals from '../../polis/client-participation/vis2/components/globals'
import { Hull } from '../../polis/client-participation/vis2/components/hull'

export default {
title: 'Client-Participation/Hull',
component: Hull,
decorators: [
(Story) => (
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width={400} height={400}>
<Story />
</svg>
)
]
}

const Template = (args) => <Hull {...args} />

export const Default = Template.bind({})
Default.args = {
gid: 2,
selectedGroup: null,
pathString: 'M422.8101166110204,163.61632504882766L412.3646448995831,228.89395991401378L401.4341938681133,269.65940938610925L279.46357662898936,304.98018771161065L217.74164128374287,245.00007079872233L227.11722756540448,220.3191358443033L414.4221203956728,122.83963557283175L422.8101166110204,163.61632504882766',
handleClick: action('Clicked'),
getHullElems: action('Created ref'),
}

export const IsSelected = Template.bind({})
IsSelected.args = {
...Default.args,
selectedGroup: 2
}

0 comments on commit 6507223

Please sign in to comment.