0.2.0 • Published 2 years ago

wcontour-js v0.2.0

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
2 years ago

wcontour-js

A JavaScript Library of wContour.

import { Contour, smoothLines, isolines, isobands } from 'wcontour-js'

const gridOptions = {
  xStart: 70,
  xEnd: 140,
  xDelta: 0.5,
  yStart: 15,
  yEnd: 55,
  yDelta: 0.5,
  xSize: 141,
  ySize: 81,
}
const data =[[...], [...]]
const xs = []
const ys = []

for (let i = 0; i < gridOptions.xSize; i++) {
  xs.push(gridOptions.xStart + i * gridOptions.xDelta)
}
for (let i = 0; i < gridOptions.ySize; i++) {
  ys.push(gridOptions.yStart + i * gridOptions.yDelta)
}
const contour = new Contour(data, xs, ys, 999999)
const breaks = [-10, 0, 10, 20, 30, 40]
const contours = contour.tracingContourLines(breaks)

// smooth
smoothLines(contours)

const polygons = contour.tracingPolygons(contours, breaks)
// 等值线(GeoJSON)
const lineFC = isolines(contours)
// 等值线多边形(GeoJSON)
const polyFC = isobands(polygons, breaks)
0.2.0

2 years ago

0.2.0-beta.2

2 years ago

0.2.0-beta.1

2 years ago

0.1.2

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago