@@ -8,7 +8,11 @@ import {
8
8
annotations ,
9
9
} from '../../../lib/chart-properties'
10
10
import { ChartProperty , Flavor } from '../../../types'
11
- import { dynamicNodeSizeValue , dynamicLinkThicknessValue } from './mapper'
11
+ import {
12
+ dynamicNodeSizeValue ,
13
+ dynamicActiveNodeSizeValue ,
14
+ dynamicLinkThicknessValue ,
15
+ } from './mapper'
12
16
13
17
const allFlavors : Flavor [ ] = [ 'svg' , 'canvas' ]
14
18
@@ -43,7 +47,6 @@ const props: ChartProperty[] = [
43
47
key : 'linkDistance' ,
44
48
group : 'Simulation' ,
45
49
type : 'number | string | (link: Link) => number' ,
46
- required : false ,
47
50
help : `Control links' distance.` ,
48
51
flavors : allFlavors ,
49
52
description : `
@@ -61,7 +64,6 @@ const props: ChartProperty[] = [
61
64
key : 'repulsivity' ,
62
65
group : 'Simulation' ,
63
66
type : 'number' ,
64
- required : false ,
65
67
help : 'Control how nodes repel each other.' ,
66
68
description : `
67
69
This value will also affect the strength
@@ -79,7 +81,6 @@ const props: ChartProperty[] = [
79
81
key : 'distanceMin' ,
80
82
group : 'Simulation' ,
81
83
type : 'number' ,
82
- required : false ,
83
84
help : 'Sets the minimum distance between nodes for the many-body force.' ,
84
85
flavors : allFlavors ,
85
86
defaultValue : defaults . distanceMin ,
@@ -88,7 +89,6 @@ const props: ChartProperty[] = [
88
89
key : 'distanceMax' ,
89
90
group : 'Simulation' ,
90
91
type : 'number' ,
91
- required : false ,
92
92
help : 'Sets the maximum disteance between nodes for the many-body force.' ,
93
93
flavors : allFlavors ,
94
94
defaultValue : defaults . distanceMax ,
@@ -102,7 +102,6 @@ const props: ChartProperty[] = [
102
102
however it will also involve more computing.
103
103
` ,
104
104
type : 'number' ,
105
- required : false ,
106
105
flavors : allFlavors ,
107
106
defaultValue : defaults . iterations ,
108
107
control : {
@@ -116,7 +115,6 @@ const props: ChartProperty[] = [
116
115
key : 'nodeComponent' ,
117
116
group : 'Nodes' ,
118
117
type : 'NetworkNodeComponent' ,
119
- required : false ,
120
118
help : `Custom node component for the SVG implementation.` ,
121
119
flavors : [ 'svg' ] ,
122
120
defaultValue : 'NetworkNode' ,
@@ -125,15 +123,13 @@ const props: ChartProperty[] = [
125
123
key : 'renderNode' ,
126
124
group : 'Nodes' ,
127
125
type : 'NetworkNodeCanvasRenderer' ,
128
- required : false ,
129
126
help : `Custom node rendering for the canvas implementation.` ,
130
127
flavors : [ 'canvas' ] ,
131
128
} ,
132
129
{
133
130
key : 'nodeSize' ,
134
131
group : 'Nodes' ,
135
132
type : 'number | (node: InputNode) => number' ,
136
- required : false ,
137
133
help : `Control nodes' size.` ,
138
134
flavors : allFlavors ,
139
135
defaultValue : defaults . nodeSize ,
@@ -146,11 +142,40 @@ const props: ChartProperty[] = [
146
142
max : 64 ,
147
143
} ,
148
144
} ,
145
+ {
146
+ key : 'activeNodeSize' ,
147
+ group : 'Nodes' ,
148
+ type : 'number | (node: InputNode) => number' ,
149
+ help : `Control active nodes' size.` ,
150
+ flavors : allFlavors ,
151
+ defaultValue : defaults . activeNodeSize ,
152
+ control : {
153
+ type : 'switchableRange' ,
154
+ disabledValue : dynamicActiveNodeSizeValue ,
155
+ defaultValue : defaults . activeNodeSize as number ,
156
+ unit : 'px' ,
157
+ min : 4 ,
158
+ max : 64 ,
159
+ } ,
160
+ } ,
161
+ {
162
+ key : 'inactiveNodeSize' ,
163
+ group : 'Nodes' ,
164
+ type : 'number | (node: InputNode) => number' ,
165
+ help : `Control inactive nodes' size.` ,
166
+ flavors : allFlavors ,
167
+ defaultValue : defaults . inactiveNodeSize ,
168
+ control : {
169
+ type : 'range' ,
170
+ unit : 'px' ,
171
+ min : 4 ,
172
+ max : 64 ,
173
+ } ,
174
+ } ,
149
175
{
150
176
key : 'nodeColor' ,
151
177
group : 'Nodes' ,
152
178
type : 'string | (node: InputNode) => string' ,
153
- required : false ,
154
179
help : `Control nodes' color.` ,
155
180
flavors : allFlavors ,
156
181
defaultValue : defaults . nodeColor ,
@@ -166,7 +191,6 @@ const props: ChartProperty[] = [
166
191
key : 'nodeBorderWidth' ,
167
192
group : 'Nodes' ,
168
193
type : 'number | (node: NetworkComputedNode) => number' ,
169
- required : false ,
170
194
help : `Control nodes' border width.` ,
171
195
flavors : allFlavors ,
172
196
defaultValue : defaults . nodeBorderWidth ,
@@ -176,7 +200,6 @@ const props: ChartProperty[] = [
176
200
key : 'nodeBorderColor' ,
177
201
group : 'Nodes' ,
178
202
type : 'InheritedColorConfig<NetworkComputedNode>' ,
179
- required : false ,
180
203
help : `Control nodes' border color.` ,
181
204
flavors : allFlavors ,
182
205
defaultValue : defaults . nodeBorderColor ,
@@ -186,7 +209,6 @@ const props: ChartProperty[] = [
186
209
key : 'linkComponent' ,
187
210
group : 'Links' ,
188
211
type : 'NetworkLinkComponent' ,
189
- required : false ,
190
212
help : `Custom link component for the SVG implementation.` ,
191
213
flavors : [ 'svg' ] ,
192
214
defaultValue : 'NetworkLink' ,
@@ -195,15 +217,13 @@ const props: ChartProperty[] = [
195
217
key : 'renderLink' ,
196
218
group : 'Links' ,
197
219
type : 'NetworkLinkCanvasRenderer' ,
198
- required : false ,
199
220
help : `Custom link rendering for the canvas implementation.` ,
200
221
flavors : [ 'canvas' ] ,
201
222
} ,
202
223
{
203
224
key : 'linkThickness' ,
204
225
group : 'Links' ,
205
226
type : 'number | (link: NetworkComputedLink) => number' ,
206
- required : false ,
207
227
help : `Control links' thickness.` ,
208
228
flavors : allFlavors ,
209
229
defaultValue : defaults . linkThickness ,
@@ -220,7 +240,6 @@ const props: ChartProperty[] = [
220
240
key : 'linkColor' ,
221
241
group : 'Links' ,
222
242
type : 'InheritedColorConfig<ComputedLink>' ,
223
- required : false ,
224
243
help : `Control links' color.` ,
225
244
flavors : allFlavors ,
226
245
defaultValue : defaults . linkColor ,
@@ -241,7 +260,6 @@ const props: ChartProperty[] = [
241
260
key : 'nodeTooltip' ,
242
261
group : 'Interactivity' ,
243
262
type : 'NetworkNodeTooltipComponent' ,
244
- required : false ,
245
263
help : 'Custom tooltip component for nodes.' ,
246
264
flavors : allFlavors ,
247
265
description : `
@@ -255,31 +273,27 @@ const props: ChartProperty[] = [
255
273
group : 'Interactivity' ,
256
274
help : 'onClick handler.' ,
257
275
type : '(node: NetworkComputedNode, event: MouseEvent) => void' ,
258
- required : false ,
259
276
flavors : allFlavors ,
260
277
} ,
261
278
{
262
279
key : 'onMouseEnter' ,
263
280
group : 'Interactivity' ,
264
281
help : 'onMouseEnter handler.' ,
265
282
type : '(node: ComputedNode, event: MouseEvent) => void' ,
266
- required : false ,
267
283
flavors : allFlavors ,
268
284
} ,
269
285
{
270
286
key : 'onMouseMove' ,
271
287
group : 'Interactivity' ,
272
288
help : 'onMouseMove handler.' ,
273
289
type : '(node: ComputedNode, event: MouseEvent) => void' ,
274
- required : false ,
275
290
flavors : allFlavors ,
276
291
} ,
277
292
{
278
293
key : 'onMouseLeave' ,
279
294
group : 'Interactivity' ,
280
295
help : 'onMouseLeave handler.' ,
281
296
type : '(node: ComputedNode, event: MouseEvent) => void' ,
282
- required : false ,
283
297
flavors : allFlavors ,
284
298
} ,
285
299
annotations ( {
@@ -300,7 +314,6 @@ const props: ChartProperty[] = [
300
314
type : `('links' | 'nodes')[] | FunctionComponent<LayerProps>` ,
301
315
group : 'Customization' ,
302
316
help : 'Defines the order of layers and add custom layers.' ,
303
- required : false ,
304
317
defaultValue : defaults . layers ,
305
318
flavors : [ 'svg' , 'canvas' ] ,
306
319
} ,
0 commit comments