Skip to content

Commit

Permalink
chore: adjust story and remove imports for deleted files
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric committed Sep 23, 2024
1 parent 08922a2 commit ec87ff7
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 45 deletions.
40 changes: 1 addition & 39 deletions src/__demo__/SingleValue.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,7 @@ const indicatorTypes = ['plain', 'percent', 'subtext']

storiesOf('SingleValue', module).add('default', () => {
const newChartRef = useRef(null)
const oldContainerRef = useRef(null)
const newContainerRef = useRef(null)
const [transpose, setTranspose] = useState(false)
const [dashboard, setDashboard] = useState(false)
const [showIcon, setShowIcon] = useState(false)
const [indicatorType, setIndicatorType] = useState('plain')
Expand All @@ -646,7 +644,7 @@ storiesOf('SingleValue', module).add('default', () => {
[width, height]
)
useEffect(() => {
if (oldContainerRef.current && newContainerRef.current) {
if (newContainerRef.current) {
requestAnimationFrame(() => {
const extraOptions = {
...baseExtraOptions,
Expand All @@ -667,15 +665,6 @@ storiesOf('SingleValue', module).add('default', () => {
dataObj.metaData.items.FnYCr2EAzWS.indicatorType =
subtextIndicatorType
}
createVisualization(
[dataObj],
layout,
oldContainerRef.current,
extraOptions,
undefined,
undefined,
'dhis'
)
const newVisualization = createVisualization(
[dataObj],
layout,
Expand Down Expand Up @@ -782,35 +771,8 @@ storiesOf('SingleValue', module).add('default', () => {
</select>
</label>
<button onClick={downloadOffline}>Download offline</button>
<button
onClick={() => {
setTranspose(!transpose)
}}
>
{transpose ? 'Show side by side' : 'Transpose old and new'}
</button>
</div>
<div style={{ display: 'flex', gap: 12 }}>
<div
style={
transpose
? {
...containerStyle,
...{
opacity: 0.45,
transform: `translateX(${width + 10}px)`,
zIndex: 10,
backgroundColor: 'purple',
},
}
: containerStyle
}
>
<div
ref={oldContainerRef}
style={innerContainerStyle}
></div>
</div>
<div style={containerStyle}>
<div
ref={newContainerRef}
Expand Down
2 changes: 0 additions & 2 deletions src/visualizations/config/adapters/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import dhis_dhis from './dhis_dhis/index.js'
import dhis_highcharts from './dhis_highcharts/index.js'

export default {
dhis_highcharts,
dhis_dhis,
}
2 changes: 0 additions & 2 deletions src/visualizations/config/generators/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import dhis from './dhis/index.js'
import highcharts from './highcharts/index.js'

export default {
highcharts,
dhis,
}
2 changes: 0 additions & 2 deletions src/visualizations/store/adapters/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import dhis_dhis from './dhis_dhis/index.js'
import dhis_highcharts from './dhis_highcharts/index.js'

export default {
dhis_highcharts,
dhis_dhis,
}

0 comments on commit ec87ff7

Please sign in to comment.