cycle-canvas
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -13,2 +13,3 @@ 'use strict'; | ||
exports.rect = rect; | ||
exports.arc = arc; | ||
exports.text = text; | ||
@@ -195,2 +196,34 @@ exports.line = line; | ||
function translateArc(element, origin) { | ||
var operations = [{ call: 'beginPath', args: [] }, { call: 'arc', args: [element.x, element.y, element.radius, element.startAngle, element.endAngle, element.anticlockwise || false] }]; | ||
element.draw.map(function (operation) { | ||
if (operation.fill) { | ||
operations.push({ | ||
set: 'fillStyle', | ||
value: operation.fill || 'black' | ||
}); | ||
operations.push({ | ||
call: 'fill', | ||
args: [] | ||
}); | ||
} | ||
if (operation.stroke) { | ||
operations.push({ | ||
set: 'strokeStyle', | ||
value: operation.stroke || 'black' | ||
}); | ||
operations.push({ | ||
call: 'stroke', | ||
args: [] | ||
}); | ||
} | ||
}); | ||
return operations; | ||
} | ||
function translateVtreeToInstructions(element, parentEl) { | ||
@@ -215,3 +248,4 @@ if (!element) { | ||
polygon: translatePolygon, | ||
image: translateImage | ||
image: translateImage, | ||
arc: translateArc | ||
}; | ||
@@ -297,2 +331,6 @@ | ||
function arc(opts, children) { | ||
return c('arc', opts, children); | ||
} | ||
function text(opts, children) { | ||
@@ -299,0 +337,0 @@ var defaults = { |
{ | ||
"name": "cycle-canvas", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A canvas driver for Cycle.js", | ||
@@ -53,2 +53,8 @@ "main": "lib/canvas-driver.js", | ||
"cycle-restart": "0.0.14", | ||
"eslint": "^4.7.2", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-node": "^5.1.1", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"keycode": "^2.1.1", | ||
@@ -55,0 +61,0 @@ "lodash": "^4.8.1", |
@@ -71,3 +71,3 @@ # cycle-canvas [![npm version](https://badge.fury.io/js/cycle-canvas.svg)](https://badge.fury.io/js/cycle-canvas) [![Build Status](https://travis-ci.org/cyclejs-community/cycle-canvas.svg?branch=master)](https://travis-ci.org/cyclejs-community/cycle-canvas) | ||
##API | ||
## API | ||
@@ -268,3 +268,3 @@ #### Creating a canvas driver | ||
##Transformations | ||
## Transformations | ||
Transformations are added as a list to the `transformations` attribute to drawing shapes and text. | ||
@@ -271,0 +271,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
21750
320
0
26