@@ -13,6 +13,7 @@ import { getNetworkEdges, getNetworkNodes } from '../../selectors/network';
1313import { edgesToCoords } from '../../selectors/canvas' ;
1414import { entityAttributesProperty } from '../../utils/network-exporters/src/utils/reservedAttributes' ;
1515import { get } from '../../utils/lodash-replacements' ;
16+ import { LayoutProvider } from '../../contexts/LayoutContext' ;
1617
1718/**
1819 * Narrative Interface
@@ -150,59 +151,65 @@ class Narrative extends Component {
150151 return (
151152 < div className = "narrative-interface" >
152153 < div className = "narrative-interface__canvas" id = "narrative-interface__canvas" >
153- < Canvas
154- className = "narrative-concentric-circles"
155- id = "concentric-circles"
156- key = { `circles- ${ currentPreset . id } ` }
154+ < LayoutProvider
155+ layout = { layoutVariable }
156+ nodes = { nodesWithLayout }
157+ edges = { edgesWithCoords }
157158 >
158- < Background
159- concentricCircles = { concentricCircles }
160- skewedTowardCenter = { skewedTowardCenter }
161- image = { backgroundImage }
162- />
163- < ConvexHulls
164- nodes = { nodesWithLayout }
165- groupVariable = { convexHullVariable }
166- layoutVariable = { layoutVariable }
167- />
168- < EdgeLayout
169- edges = { edgesWithCoords }
170- />
171- {
172- freeDraw && (
173- < Annotations
174- ref = { this . annotationLayer }
175- isFrozen = { isFrozen }
176- onChangeActiveAnnotations = { this . handleChangeActiveAnnotations }
177- />
178- )
179- }
180- < NodeLayout
181- nodes = { nodesWithLayout }
182- id = "NODE_LAYOUT"
183- highlightAttribute = {
184- ( showHighlightedNodes ? highlight [ highlightIndex ] : null )
159+ < Canvas
160+ className = "narrative-concentric-circles"
161+ id = "concentric-circles"
162+ key = { `circles-${ currentPreset . id } ` }
163+ >
164+ < Background
165+ concentricCircles = { concentricCircles }
166+ skewedTowardCenter = { skewedTowardCenter }
167+ image = { backgroundImage }
168+ />
169+ < ConvexHulls
170+ nodes = { nodesWithLayout }
171+ groupVariable = { convexHullVariable }
172+ layoutVariable = { layoutVariable }
173+ />
174+ < EdgeLayout
175+ edges = { edgesWithCoords }
176+ />
177+ {
178+ freeDraw && (
179+ < Annotations
180+ ref = { this . annotationLayer }
181+ isFrozen = { isFrozen }
182+ onChangeActiveAnnotations = { this . handleChangeActiveAnnotations }
183+ />
184+ )
185185 }
186- layoutVariable = { layoutVariable }
187- allowPositioning = { allowRepositioning }
186+ < NodeLayout
187+ nodes = { nodesWithLayout }
188+ id = "NODE_LAYOUT"
189+ highlightAttribute = {
190+ ( showHighlightedNodes ? highlight [ highlightIndex ] : null )
191+ }
192+ layoutVariable = { layoutVariable }
193+ allowPositioning = { allowRepositioning }
194+ />
195+ </ Canvas >
196+ < PresetSwitcher
197+ id = "drop-obstacle"
198+ presets = { presets }
199+ activePreset = { presetIndex }
200+ highlightIndex = { highlightIndex }
201+ isFrozen = { isFrozen }
202+ shouldShowResetButton = { shouldShowResetButton }
203+ shouldShowFreezeButton = { freeDraw }
204+ onResetInteractions = { this . handleResetInteractions }
205+ onChangePreset = { this . handleChangePreset }
206+ onToggleFreeze = { this . handleToggleFreeze }
207+ onToggleHulls = { this . handleToggleHulls }
208+ onToggleEdges = { this . handleToggleEdges }
209+ onChangeHighlightIndex = { this . handleChangeHighlightIndex }
210+ onToggleHighlighting = { this . handleToggleHighlighting }
188211 />
189- </ Canvas >
190- < PresetSwitcher
191- id = "drop-obstacle"
192- presets = { presets }
193- activePreset = { presetIndex }
194- highlightIndex = { highlightIndex }
195- isFrozen = { isFrozen }
196- shouldShowResetButton = { shouldShowResetButton }
197- shouldShowFreezeButton = { freeDraw }
198- onResetInteractions = { this . handleResetInteractions }
199- onChangePreset = { this . handleChangePreset }
200- onToggleFreeze = { this . handleToggleFreeze }
201- onToggleHulls = { this . handleToggleHulls }
202- onToggleEdges = { this . handleToggleEdges }
203- onChangeHighlightIndex = { this . handleChangeHighlightIndex }
204- onToggleHighlighting = { this . handleToggleHighlighting }
205- />
212+ </ LayoutProvider >
206213 </ div >
207214 </ div >
208215 ) ;
0 commit comments