<commit_before>class window.BaseFactWheelView extends Backbone.Marionette.ItemView
  className: "wheel"
  defaults:
    respondsToMouse: true
    showsTooltips: true

    dimension: 16
    radius: 16
    minimalVisiblePercentage: 15
    defaultStroke:
      opacity: 0.2
      width: 9

    hoverStroke:
      opacity: 0.5
      width: 11

    userOpinionStroke:
      opacity: 1.0

    opinionStyles:
      believe:
        groupname: Factlink.Global.t.fact_believe_opinion?.titleize()
        color: "#98d100"
      doubt:
        groupname: Factlink.Global.t.fact_doubt_opinion?.titleize()
        color: "#36a9e1"
      disbelieve:
        groupname: Factlink.Global.t.fact_disbelieve_opinion?.titleize()
        color: "#e94e1b"

  template: "facts/fact_wheel"

  initialize: (options) ->
    @options = $.extend({}, @defaults, options)
    @opinionTypeRaphaels = {}

  onRender: ->
    @renderRaphael()
    @randomActions()

  render: ->
    if @already_rendered
      @reRender()
    else
      super()
      @already_rendered = true
    @

  renderRaphael: ->
    @$canvasEl = $('<div></div>')
    @$canvasEl.addClass 'fact-wheel-responding-to-mouse' if @options.respondsToMouse

    @$('.raphael_container').html(@$canvasEl)
    @canvas = Raphael(@$canvasEl[0], @options.dimension * 2 + 12, @options.dimension * 2 + 12)
    @bindCustomRaphaelAttributes()

  randomActions: ->
    offset = 0
    @calculateDisplayablePercentages()
    for key, opinionType of @model.get('opinion_types')<commit_msg>Made defaults overrideable by sub class<commit_after>class window.BaseFactWheelView extends Backbone.Marionette.ItemView
  className: "wheel"
  defaults:
    respondsToMouse: true
    showsTooltips: true

    dimension: 16
    radius: 16
    minimalVisiblePercentage: 15
    defaultStroke:
      opacity: 0.2
      width: 9

    hoverStroke:
      opacity: 0.5
      width: 11

    userOpinionStroke:
      opacity: 1.0

    opinionStyles:
      believe:
        groupname: Factlink.Global.t.fact_believe_opinion?.titleize()
        color: "#98d100"
      doubt:
        groupname: Factlink.Global.t.fact_doubt_opinion?.titleize()
        color: "#36a9e1"
      disbelieve:
        groupname: Factlink.Global.t.fact_disbelieve_opinion?.titleize()
        color: "#e94e1b"

  template: "facts/fact_wheel"

  initialize: (options) ->
    @options = $.extend(true, {}, BaseFactWheelView.prototype.defaults, @defaults, options)
    @opinionTypeRaphaels = {}

  onRender: ->
    @renderRaphael()
    @randomActions()

  render: ->
    if @already_rendered
      @reRender()
    else
      super()
      @already_rendered = true
    @

  renderRaphael: ->
    @$canvasEl = $('<div></div>')
    @$canvasEl.addClass 'fact-wheel-responding-to-mouse' if @options.respondsToMouse

    @$('.raphael_container').html(@$canvasEl)
    @canvas = Raphael(@$canvasEl[0], @options.dimension * 2 + 12, @options.dimension * 2 + 12)
    @bindCustomRaphaelAttributes()

  randomActions: ->
    offset = 0
    @calculateDisplayablePercentages()
    for key, opinionType of @model.get('opinion_types')
{'fraction_non_alphanumeric': 0.12134977287475665, 'fraction_numerical': 0.0227125243348475, 'mean_word_length': 2.983204134366925, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '6196715', 'n_tokens_mistral': 1104, 'n_tokens_neox': 986, 'n_words': 189}