Data2viz
.play
Explore
Sketches
Create
Sketch
Documentation
Let's start
Core mechanisms
Colors and gradients
Scales
Chromatic Scales
Forces
Random numbers
Fork
View
Editor
Details
Sign up
Log in
ticks cancel & display (WIP)
import io.data2viz.charts.* import io.data2viz.charts.dimension.* import io.data2viz.charts.chart.* import io.data2viz.charts.chart.mark.* import io.data2viz.charts.viz.* import io.data2viz.charts.core.* import io.data2viz.charts.core.Zoom import io.data2viz.charts.core.SelectionMode import io.data2viz.charts.core.Datum import io.data2viz.charts.layout.* import io.data2viz.geom.* import io.data2viz.color.* import io.data2viz.math.* import kotlin.random.Random import kotlinx.browser.document import org.w3c.dom.* val numPoint = 200 val randomPoints = (1 .. numPoint).map{ Point(Random.nextDouble(), Random.nextDouble() * 3 - 0.36) }.sortedBy { it.x } val chartWidth = 700.0 val chartHeight = 100.0 private var displayWidth = chartWidth private var displayHeight = chartHeight lateinit var myChart: Chart<Point> var zoom = Zoom.IDENTITY fun main() { val vc = newVizContainer().apply { size = Size(chartWidth, chartHeight) } myChart = vc.chart(randomPoints) { config { // Disable user-input highlight & selection from the chart events { zoomMode = ZoomMode.Y panMode = PanMode.Y selectionMode = SelectionMode.None highlightMode = HighlightMode.None } } val xPosition = quantitative( { domain.x } ) val yPosition = quantitative( { domain.y } ) plot(xPosition, yPosition) } }
Sketch created by
pierre
936
0
0
Description
comments
Submit
Lovers
comments