# Editable Force Graph as viewof

**URL:** https://talk.observablehq.com/t/editable-force-graph-as-viewof/1942
**Category:** Help
**Created:** [May 2, 2019, 3:37pm UTC](https://talk.observablehq.com/t/editable-force-graph-as-viewof/1942 "2019-05-02T15:37:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RLesser](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/rlesser/32/1715_2.png) [@RLesser](https://talk.observablehq.com/u/RLesser)
#### Post date: [May 2, 2019, 3:37pm UTC](https://talk.observablehq.com/t/editable-force-graph-as-viewof/1942/1 "2019-05-02T15:37:11Z")

</div>

Hi,

I’ve been trying to adapt my [editable force graph notebook](https://observablehq.com/@rlesser/build-your-own-force-directed-graph) into one where the rendering and editable data are combined, as this would make it more modifiable and compact. Based on what I’ve read of `viewof` it seems that having my graph be a `viewof graph` and the underlying data be the value associated with `graph` would serve this purpose well, as `viewof` is inherently mutable.

I’ve made a basic (and incomplete) attempt at this in [this notebook](https://observablehq.com/@rlesser/force-graph-viewof-test), but it definitely is not working and I’m unsure of how exactly to make it even show the nodes update correctly, let alone edit it from within the block or from other blocks. Any advice on how to make something like this work?

Thanks!

---

<div class="post-metadata">

### Author: ![rezpe](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/rezpe/32/1422_2.png) [@rezpe](https://talk.observablehq.com/u/rezpe)
#### Post date: [May 9, 2019, 1:44pm UTC](https://talk.observablehq.com/t/editable-force-graph-as-viewof/1942/2 "2019-05-09T13:44:42Z")

</div>

Hi,

You not only need to change the value of the element, you also have to dispatch an “input” event, so viewof updates the value.  
You have a neat example here: [https://observablehq.com/@darthmall/svg-input](https://observablehq.com/@darthmall/svg-input)

Regards,  
Sebas
