Skip to content

[v8 branch] shape change error #17

Description

@Enteleform

Variant 1

On an empty NapChart, change the shape view. (sometimes requires multiple changes)

TypeError: "ouch" is not a constructor
helpers.XYtoInfo
D:/Temp/napchart-website/src/canvas/shape/shapeHelpers.js:81
  78 |    }
  79 | 
  80 |    if (isNaN(minutes) || isNaN(distance)) {
> 81 |      throw new 'ouch'()
  82 |    }
  83 | 
  84 |    var lanes = chart.shape.lanes
View compiled
hitDetect
D:/Temp/napchart-website/src/canvas/interactCanvas/hitDetect.js:43
  40 |    // if no handle is hit, check for middle hit
  41 | 
  42 |  if (Object.keys(hit).length == 0) {
> 43 |    var info = helpers.XYtoInfo(chart, coordinates.x, coordinates.y)
  44 |    if(!info){
  45 |      return {}
  46 |    }
View compiled
move
D:/Temp/napchart-website/src/canvas/interactCanvas/interactCanvas.js:157
  154 |    }
  155 | 
  156 |    // add hover
> 157 |    var hit = hitDetect(chart, coordinates)
  158 |    if (Object.keys(hit).length == 0) {
  159 |      // if no hit
  160 |      // - check if hovers an empty space on lane
View compiled
HTMLDocument.<anonymous>
D:/Temp/napchart-website/src/canvas/interactCanvas/interactCanvas.js:43
  40 |          e.stopPropagation()
  41 |          e.preventDefault()
  42 |        }
> 43 |        move(e, chart)
  44 |      })
  45 | 
  46 |      // down
View compiled
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.

 

Variant 2

On an empty NapChart, create an element, and then change the shape view.
(This appears to be the same error as #15)

TypeError: Cannot read property 'text' of undefined
focusSelected
D:/Temp/napchart-website/src/canvas/interactCanvas/keyboard.js:41
  38 | 
  39 |    function focusSelected(selected) {
  40 |      var selectedElement = chart.data.elements.find(e => e.id == selected)
> 41 |      input.value = selectedElement.text
  42 |      input.focus()
  43 |      positionInput(input, selectedElement)
  44 |      input.oninput = function (e) {
View compiled
chart.onSetSelected
D:/Temp/napchart-website/src/canvas/interactCanvas/keyboard.js:35
  32 |      }
  33 | 
  34 |      if (!chart.isTouchUser) {
> 35 |        focusSelected(selected)
  36 |      }
  37 |    }
  38 | 
View compiled
setSelected
D:/Temp/napchart-website/src/canvas/core.js:50
  47 |        this.selectedElement = id
  48 |        this.onUpdate()
  49 | 
> 50 |        this.onSetSelected(id)
  51 | 
  52 |        draw(this)
  53 |      },
View compiled
select
D:/Temp/napchart-website/src/canvas/interactCanvas/interactCanvas.js:523
  520 | 
  521 |  function select(chart, id) {
  522 |    // notify core module:
> 523 |    chart.setSelected(id)
  524 |  }
  525 | 
  526 |  function deselect(chart, element) {
View compiled
up
D:/Temp/napchart-website/src/canvas/interactCanvas/interactCanvas.js:185
  182 |    }
  183 | 
  184 |    if (keepAlive) {
> 185 |      select(chart, keepAlive)
  186 |      keepAlive = false
  187 |    }
  188 | 
View compiled
(anonymous function)
D:/Temp/napchart-website/src/canvas/interactCanvas/interactCanvas.js:66
  63 |      addListeners(window, 'mouseup touchend', e => {
  64 |        // e.stopPropagation()
  65 |        // e.preventDefault()
> 66 |        up(e, chart)
  67 |      })
  68 | 
  69 |      // initialize keyboard bindings
View compiled
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions