<commit_before>Ext.define "Muleview.Graphs",
  singleton: true

  createGraphs: ->
    @mainPanel = Ext.getCmp("mainPanel")
    @rightPanel = Ext.getCmp("rightPanel")

    # Reset and initiate display progress start:
    @retentions = {}
    @mainPanel.removeAll();
    @mainPanel.setLoading(true)
    @rightPanel.removeAll()
    @rightPanel.setLoading(true)

    # Obtain data:
    Muleview.Mule.getKeyData Muleview.currentKey, (data) =>
      for own retention, retentionData of data
        @retentions[retention] = @createRetentionGraphs(retention, retentionData)
        firstTab ||= @retentions[retention].graph


      @rightPanel.add(ret.lightGraph for _, ret of @retentions)
      @mainPanel.add(ret.graph for _, ret of @retentions )
      @mainPanel.setActiveTab(firstTab)
      @mainPanel.setLoading(false)
      @rightPanel.setLoading(false)

  createRetentionGraphs: (retName, retRawData) ->
    keys = Ext.Object.getKeys(retRawData)
    store = @createStore(retRawData, keys)
    mainGraphPanel = Ext.create "Ext.panel.Panel",
      title: retName
      retention: retName
      layout: "fit"
      items: [
        Ext.create "Muleview.view.MuleChart",
          showAreas: true
          keys: keys
          store: store
      ]
<commit_msg>Minor bug fix<commit_after>Ext.define "Muleview.Graphs",
  singleton: true

  createGraphs: ->
    @mainPanel = Ext.getCmp("mainPanel")
    @rightPanel = Ext.getCmp("rightPanel")

    # Reset and initiate display progress start:
    @retentions = {}
    @mainPanel.removeAll();
    @mainPanel.setLoading(true)
    @rightPanel.removeAll()
    @rightPanel.setLoading(true)

    # Obtain data:
    Muleview.Mule.getKeyData Muleview.currentKey, (data) =>
      firstTab = null
      for own retention, retentionData of data
        @retentions[retention] = @createRetentionGraphs(retention, retentionData)
        firstTab ||= @retentions[retention].graph


      @rightPanel.add(ret.lightGraph for _, ret of @retentions)
      @mainPanel.add(ret.graph for _, ret of @retentions )
      @mainPanel.setActiveTab(firstTab)
      @mainPanel.setLoading(false)
      @rightPanel.setLoading(false)

  createRetentionGraphs: (retName, retRawData) ->
    keys = Ext.Object.getKeys(retRawData)
    store = @createStore(retRawData, keys)
    mainGraphPanel = Ext.create "Ext.panel.Panel",
      title: retName
      retention: retName
      layout: "fit"
      items: [
        Ext.create "Muleview.view.MuleChart",
          showAreas: true
          keys: keys
          store: store
      ]

{'fraction_non_alphanumeric': 0.11150512214342001, 'fraction_numerical': 0.0, 'mean_word_length': 3.0559105431309903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2470564', 'n_tokens_mistral': 822, 'n_tokens_neox': 809, 'n_words': 154}