Skip to content

Commit b115f70

Browse files
committedDec 31, 2021
feat(network): fix website icon due to API changes
1 parent 1b03cec commit b115f70

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed
 

‎website/src/components/icons/Icons.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import GeoMapIcon from './GeoMapIcon'
1515
import HeatMapIcon from './HeatMapIcon'
1616
import LineIcon from './LineIcon'
1717
import MarimekkoIcon from './MarimekkoIcon'
18-
import NetworkIcon from './NetworkIcon'
18+
import { NetworkIcon } from './NetworkIcon'
1919
import PieIcon from './PieIcon'
2020
import RadarIcon from './RadarIcon'
2121
import { RadialBarIcon } from './RadialBarIcon'

‎website/src/components/icons/NetworkIcon.js ‎website/src/components/icons/NetworkIcon.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import networkLightColoredImg from '../../assets/icons/network-light-colored.png
55
import networkDarkNeutralImg from '../../assets/icons/network-dark-neutral.png'
66
import networkDarkColoredImg from '../../assets/icons/network-dark-colored.png'
77
import { ICON_SIZE, Icon, colors, IconImg } from './styled'
8+
import { IconType } from './types'
89

9-
const getData = currentColors => {
10+
const getData = (currentColors: any) => {
1011
let nodes = 'ABCDE'.split('').map(id => ({
1112
id,
1213
radius: 5,
@@ -18,7 +19,7 @@ const getData = currentColors => {
1819
distance: 2,
1920
}))
2021

21-
const leaves = []
22+
const leaves: any[] = []
2223
nodes.forEach(node => {
2324
Array.from({ length: 7 }, (v, k) => {
2425
leaves.push({
@@ -43,21 +44,22 @@ const getData = currentColors => {
4344
const chartProps = {
4445
width: ICON_SIZE,
4546
height: ICON_SIZE,
46-
distance: link => link.distance,
47+
linkDistance: (link: any) => link.distance,
4748
repulsivity: 5,
4849
linkThickness: 2,
50+
nodeColor: (node: any) => node.color,
4951
linkColor: { from: 'source.color' },
5052
animate: false,
5153
isInteractive: false,
5254
}
5355

54-
const NetworkIconItem = ({ type }) => (
56+
const NetworkIconItem = ({ type }: { type: IconType }) => (
5557
<Icon id={`network-${type}`} type={type}>
56-
<Network {...chartProps} {...getData(colors[type].colors)} />
58+
<Network {...chartProps} data={getData(colors[type].colors)} />
5759
</Icon>
5860
)
5961

60-
const NetworkIcon = () => (
62+
export const NetworkIcon = () => (
6163
<>
6264
<NetworkIconItem type="lightNeutral" />
6365
<IconImg url={networkLightNeutralImg} />
@@ -69,5 +71,3 @@ const NetworkIcon = () => (
6971
<IconImg url={networkDarkColoredImg} />
7072
</>
7173
)
72-
73-
export default NetworkIcon

‎website/src/components/icons/RadialBarIcon.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const RadialBarIconItem = ({ type }: { type: IconType }) => (
3737
radialAxisStart={null}
3838
circularAxisOuter={null}
3939
animate={false}
40+
isInteractive={false}
4041
/>
4142
</Icon>
4243
)

0 commit comments

Comments
 (0)
Please sign in to comment.