title: Plotly Dash Cannot Create Graphs Dynamically
body: <p>I'm creating a web app using plotly dash for graph generation and callback handling. I use dash-core-components v0.18.1</p>
  
  <p>When trying to add graphs dynamically (each time a button is clicked, a new graph is added), an error appears in the console:</p>
  
  <blockquote>
    <p>bundle.js?v=0.11.2:9 Uncaught (in promise) Error: dash_core_components
    was not found. at Object.resolve (bundle.js?v=0.11.2:9) at s
    (bundle.js?v=0.11.2:9) at Array.map () at s (bundle.js?v=0.11.2:9) at
    Array.map () at s (bundle.js?v=0.11.2:9) at Array.map () at s
    (bundle.js?v=0.11.2:9) at e.value (bundle.js?v=0.11.2:9) at
    p._renderValidatedComponentWithoutOwnerOrContext
    (react-dom@15.4.2.min.js?v=0.11.2:13)</p>
  </blockquote>
  
  <p>I just have a blank page with a button and a callback on click.
  The callback simply fills a div with a graph.</p>
  
  <p><strong>Layout code:</strong></p>
  
  <pre><code>class ContentController(object):
  
      graph_names = None
  
      def __init__(self):
          self.graph_names = []
          # UNCOMMENT THIS LINE TO MAKE IT WORK
          # self.graph_names = ["start_graph"]
  
      def layout(self):
          return html.Div([html.Button("Add Graph", id='button_id'),
                           html.Div(self.graphics_layout, id='graphics_div')],
                          id='main_div')
  
      @property
      def graphics_layout(self):
          graphs = []
          for name in self.graph_names:
              graph = self.create_graph()
              graphs.append(dcc.Graph(id=name, figure=graph, style=    {'width': '600px', 'height': '300px'}))
  
          return graphs
  
      def create_graph(self):
          graph_data = {
                 'data': [
                     {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar',     'name': 'SF'},
                     {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar',     'name': u'Montréal'},
                 ],
                 'layout': {
                     'title': 'Dash Data Visualization'
                 }
             }
          return graph_data
  </code></pre>
  
  <p><strong>Callback Code</strong></p>
  
  <pre><code>@app.callback(
      Output(component_id='graphics_div', component_property='children'),
      [Input(component_id='button_id', component_property='n_clicks')]
  )
  def callback_function(n_clicks):
      print(n_clicks)
      if n_clicks is None:
          return ""
  
      name = "graph_" + str(n_clicks)
      content.graph_names.append(name)
      return content.graphics_layout
  </code></pre>
  
  <p>The weird thing is that if another graph is present when loading the page, then everything works fine. Is this a bug in Dash?</p>