regl-line2d

WebJar for regl-line2d

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

regl-line2d
Последняя версия

Последняя версия

3.0.18
Дата

Дата

Тип

Тип

jar
Описание

Описание

regl-line2d
WebJar for regl-line2d
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/gl-vis/regl-line2d

Скачать regl-line2d

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/regl-line2d/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>regl-line2d</artifactId>
    <version>3.0.18</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/regl-line2d/
implementation 'org.webjars.npm:regl-line2d:3.0.18'
// https://jarcasting.com/artifacts/org.webjars.npm/regl-line2d/
implementation ("org.webjars.npm:regl-line2d:3.0.18")
'org.webjars.npm:regl-line2d:jar:3.0.18'
<dependency org="org.webjars.npm" name="regl-line2d" rev="3.0.18">
  <artifact name="regl-line2d" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='regl-line2d', version='3.0.18')
)
libraryDependencies += "org.webjars.npm" % "regl-line2d" % "3.0.18"
[org.webjars.npm/regl-line2d "3.0.18"]

Зависимости

compile (11)

Идентификатор библиотеки Тип Версия
org.webjars.npm : glslify jar [7.0.0,8)
org.webjars.npm : earcut jar [2.1.5,3)
org.webjars.npm : object-assign jar [4.1.1,5)
org.webjars.npm : pick-by-alias jar [1.2.0,2)
org.webjars.npm : to-float32 jar [1.0.1,2)
org.webjars.npm : array-bounds jar [1.0.1,2)
org.webjars.npm : parse-rect jar [1.2.0,2)
org.webjars.npm : flatten-vertex-data jar [1.0.2,2)
org.webjars.npm : es6-weak-map jar [2.0.3,3)
org.webjars.npm : array-normalize jar [1.1.4,2)
org.webjars.npm : color-normalize jar [1.5.0,2)

Модули Проекта

Данный проект не имеет модулей.

regl-line2d experimental

Draw polyline with regl.

regl-line2d

Remake on gl-line2d:

  • GPU join calculation.
  • Bevel, round and rectangular joins.
  • Dash patterns.
  • Self-overlapping and sharp angles cases.
  • Multiline rendering.
  • Float64 precision.
  • <polyline>-compatible API

Demo.

Usage

npm install regl-line2d

let regl = require('regl')({extensions: 'angle_instanced_arrays'})
let line2d = require('regl-line2d')(regl)

// draw red triangle
line2d.render({ thickness: 4, points: [0,0, 1,1, 1,0], close: true, color: 'red' })

line2d.render(options|list?)

Draw line or multiple lines and update options, once per frame at most.

Option Default Description
positions, points, data [] Point coordinates, eg. [0,0, 1,1, 0,2, 1,-1] or [[0,0], [1,1], [0,2], [1,-1]].
color, colors, stroke black CSS color string or an array with 0..1 values, eg. 'red' or [0, 0, 0, 1].
fill null Fill area enclosed by line with defined color.
opacity 1 Line transparency regardless of color.
thickness, lineWidth, width, strokeWidth 1 Line width in px.
dashes, dash, dasharray null Array with dash lengths in px, altering color/space pairs, ie. [2,10, 5,10, ...]. null corresponds to solid line.
join, type bevel Join style: 'rect', 'round', 'bevel'. Applied to caps too.
miterLimit 1 Max ratio of the join length to the thickness.
close, closed, closePath false Connect last point with the first point with a segment.
overlay false Enable overlay of line segments.
range, dataBox null Visible data range.
viewport, viewBox null Area within canvas, an array [left, top, right, bottom] or an object {x, y, w, h} or {left, top, bottom, right}.

To render multiple lines pass an array with options for every line as list:

line2d.render([
  {thickness: 2, points: [0,0, 1,1], color: 'blue'},
  {thickness: 2, points: [0,1, 1,0], color: 'blue'}
])

null argument will destroy line2d instance and dispose resources.

line2d.update(options|list)

Update line(s) not incurring redraw.

line2d.draw(id?)

Draw lines from last updated options. id integer can specify a single line from the list to redraw.

line2d.destroy()

Dispose line2d and associated resources.

Related

Similar

License

(c) 2017 Dima Yv. MIT License

Development supported by plot.ly.

org.webjars.npm

Версии библиотеки

Версия
3.0.18
3.0.15
3.0.13
3.0.12
2.1.5