How to use the raphael.getColor function in raphael

To help you get started, we’ve selected a few raphael examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / InfraBox / src / dashboard / client / utils / GanttChart.ts View on Github external
public draw() {
        this.sortJobs();
        const color = Raphael.getColor();

        // calculate label offset
        for (const job of this.jobs) {
            const l = this.r.text(0, 0, job.name)
                .attr({
                    "font": '13px Helvetica, Arial',
                    "font-weight": "bold",
                    "fill": "#676a6c"
                });
            const width = l.getBBox().width;
            l.hide();

            if (width > this.labelOffset) {
                this.labelOffset = width + this.box_padding + this.box_width;
            }
        }
github SAP / InfraBox / src / dashboard-client / src / components / build / Gantt.vue View on Github external
draw() {
        this.sortJobs()
        const color = Raphael.getColor()

        // calculate label offset
        for (const job of this.jobs) {
            const l = this.r.text(0, 0, job.name)
                .attr({
                    'font': '13px Helvetica, Arial',
                    'font-weight': 'bold',
                    'fill': '#676a6c'
                })
            const width = l.getBBox().width
            l.hide()

            if (width > this.labelOffset) {
                this.labelOffset = width + this.box_padding + this.box_width
            }
        }
github Kaniwani / kw-frontend / app / common / components / KanjiStroke / dmak-0-3-1.js View on Github external
function cb() {
    // The stroke object may have been already erased when we reach this timeout
    if (stroke.object.path === null) {
      return;
    }

    let color = options.stroke.attr.stroke;
    if (options.stroke.attr.stroke === 'random') {
      color = Raphael.getColor();
    }

    // Revert back to the default color.
    stroke.object.path.node.style.stroke = color;
    stroke.object.path.node.style.transition = stroke.object.path.node.style.WebkitTransition =
      'stroke 400ms ease';

    timeouts.shift();
  }
github SAP / InfraBox / src / dashboard-client / src / components / build / Gantt.vue View on Github external
draw() {
        this.sortJobs()
        const color = Raphael.getColor()

        // calculate label offset
        for (const job of this.jobs) {
            const l = this.r.text(0, 0, job.name)
                .attr({
                    'font': '13px Helvetica, Arial',
                    'font-weight': 'bold',
                    'fill': '#676a6c'
                })
            const width = l.getBBox().width
            l.hide()

            if (width > this.labelOffset) {
                this.labelOffset = width + this.box_padding + this.box_width
            }
        }