Skip to content
Snippets Groups Projects
Select Git revision
  • 88bdc981088faeba82adb888c4472bfc59c29d96
  • v2018.2.x default protected
  • 0x4A6F-rpi4
  • 0x4A6F-master
  • master
  • v2018.2.2-ffs
  • v2016.2.4-batmanbug
  • radv-filterd
  • v2016.2.x
  • hoodselector
  • v2016.1.x
  • babel
  • v2015.1.x
  • 2014.4.x
  • 2014.3.x
  • v2018.2.2-ffs0.1
  • v2018.2.1-ffs0.1
  • v2018.2.1
  • v2018.2-ffs0.1
  • v2018.2
  • v2018.1.4
  • v2018.1.3
  • v2018.1.2
  • v2018.1.1
  • v2018.1
  • v2017.1.8
  • v2017.1.7
  • v2017.1.6
  • v2017.1.5
  • v2017.1.4
  • v2017.1.3
  • v2017.1.2
  • v2016.2.7
  • v2017.1.1
  • v2017.1
35 results

nodeinfo.js

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    signal.js 866 B
    "use strict"
    define(function () {
      return function (color) {
        var canvas = document.createElement("canvas")
        var ctx = canvas.getContext("2d")
        var v = null
        var radius = 1.2
        var highlight = false
    
        function drawPixel(x, y) {
          ctx.beginPath()
          ctx.fillStyle = color
          ctx.arc(x, y, radius, 0, Math.PI * 2, false)
          ctx.closePath()
          ctx.fill()
        }
    
        this.resize = function (w, h) {
          canvas.width = w
          canvas.height = h
        }
    
        this.draw = function (x, scale) {
          var y = scale(v)
    
          ctx.clearRect(x, 0, 5, canvas.height)
    
          if (y)
            drawPixel(x, y)
        }
    
        this.canvas = canvas
    
        this.set = function (d) {
          v = d
        }
    
        this.setHighlight = function (d) {
          highlight = d
        }
    
        this.getHighlight = function () {
          return highlight
        }
    
        return this
      }
    })