# How to avoid dcc.Graph redraw when i change the slider, does it have simple way?

**URL:** <https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721>\
**Category:** Dash Python\
**Created:** [June 30, 2017, 11:00am UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721 "2017-06-30T11:00:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmybow](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jimmybow/32/6281_2.png) [@jimmybow](https://community.plotly.com/u/jimmybow)\
**Post date:** [June 30, 2017, 11:00am UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/1 "2017-06-30T11:00:36Z")

</div>

how to avoid dcc.Graph of plotly scattergeo redraw …when i change the slider, does it have simple way?

> **[Lines on Maps](https://plot.ly/python/lines-on-maps/)**
>
> How to draw lines, great circles, and contours on maps in Python.

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [July 3, 2017, 9:14pm UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/2 "2017-07-03T21:14:42Z")

</div>

This isn’t supported right now but it will be in the future natively.

---

<div class="post-metadata">

**Author:** ![jimmybow](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jimmybow/32/6281_2.png) [@jimmybow](https://community.plotly.com/u/jimmybow)\
**Post date:** [July 21, 2017, 7:11am UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/3 "2017-07-21T07:11:24Z")

</div>

I create a dcc for relayout graph, and it’s easy to use 😆

> **[jimmybow/mydcc](https://github.com/jimmybow/mydcc#3-mydccrelayout-)**
>
> Contribute to mydcc development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [July 24, 2017, 5:55pm UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/4 "2017-07-24T17:55:56Z")

</div>

Nice! I’ve also created an issue for this in the Plotly.js repo that will make this easier to implement in the `Graph.react.js` component: [https://github.com/plotly/plotly.js/issues/1850](https://github.com/plotly/plotly.js/issues/1850).

---

<div class="post-metadata">

**Author:** ![arshiyan](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@arshiyan](https://community.plotly.com/u/arshiyan)\
**Post date:** [May 18, 2018, 9:32am UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/5 "2018-05-18T09:32:44Z")

</div>

On using mydcc.Relayout & dcc.Graph 's clickData together makes the page crash.

```
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, Event, State
import mydcc

app = dash.Dash()
app.layout = html.Div([
    mydcc.Relayout( id = "rrr", aim = 'graph' ),
    dcc.Graph( id = 'graph',
               figure = { 'data': [{'x': [1, 2, 3], 'y': [4, 1, 2]} ] }
              ),
    dcc.Input(id = 'in',
              placeholder = 'Enter a title ...',
              type = 'text',
              value = ''  
              ),
    html.Div('xxx',id='view')
])

@app.callback(
    Output('rrr', 'layout'),
    [Input('in', 'value')])
def myfun(x):
    return {'title':x}

@app.callback(
    Output('view', 'children'),
    [Input('graph', 'clickData')])
def bStoreEditor(clickData):
    print(clickData)
    return 'yyy'

if __name__ == ' __main__':
    app.run_server(debug=True)
```

---

<div class="post-metadata">

**Author:** ![jimmybow](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jimmybow/32/6281_2.png) [@jimmybow](https://community.plotly.com/u/jimmybow)\
**Post date:** [May 19, 2018, 12:07am UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/6 "2018-05-19T00:07:43Z")

</div>

… for some reason it render again and again, I will try how to improve it @@

> <https://github.com/jimmybow/mydcc/blob/master/src/components/Relayout.react.js>

---

<div class="post-metadata">

**Author:** ![jimmybow](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jimmybow/32/6281_2.png) [@jimmybow](https://community.plotly.com/u/jimmybow)\
**Post date:** [May 19, 2018, 4:10am UTC](https://community.plotly.com/t/how-to-avoid-dcc-graph-redraw-when-i-change-the-slider-does-it-have-simple-way/4721/7 "2018-05-19T04:10:27Z")

</div>

The problem fixed in version 0.1.22.  
thanks for your feedback 😆
