smart_arrays_plot_polyline 2.0.10 smart_arrays_plot_polyline: ^2.0.10 copied to clipboard
Plots one-dimensional arrays as polylines (curves) in the browser, along with axes and legend text, with versatile view options.
Smart Arrays Plot Polyline #
What the package can do for you #
- This package was designed for Web applications which need to plot 1D arrays in form of polylines (curves in the x, y plane).
- A plot may consist of one or several polylines (scaled relative to each other if desired), optionally with x and y axes, a coordinate grid, a text legend, selection icons, and marker text.
- Many array viewing options are provided, such as colors, fonts, zooming, scaling, shifting, rotation, layout parameters.
- Also, lists of points represented by circles or other shapes can be drawn, e.g.to draw a curve using individual points rather than connecting the points by polylines.
- The arrays to be plotted may have small or big sizes (even e.g. 1 million points). To achieve fast plotting without loosing information given typical screen or window sizes, a suitable data compression is applied before plotting (using the compression package listed at the end of the document).
- Plotting is performed using Scalable Vector Graphics SVG.
Example #
-
The provided example can be directly executed via https://smart.specpad.bplaced.net/smart_arrays_plot_polyline/example.html.
-
View more plot examples (generated by other packages): https://smart.specpad.bplaced.net/smart_lorentz_gauss/example.html. https://smart.specpad.bplaced.net/smart_signal_processing/example.html. https://smart.specpad.bplaced.net/smart_arrays_lmfit/example.html.
-
Or, download a package from the ones above and execute the file
example/example.html
in your browser.
The major API functionalities #
-
Class
SimplePlot
to create a plot from several arrays, with x and y axes, a text legend and a coordinate grid with just a few lines of code. -
Class
Polyline
to construct a polyline plot of desired size from an array with optional layout and viewing parameters. -
Class
Axis
to construct an x and/or y axis for a polyline plot. -
Class
XYGrid
to construct a rectangular coordinate grid consisting of horizontal and/or vertical lines, to be used to overlay a polyline plot. -
Class
Legend
to construct a legend consisting of a text line at the top ("top title") and optionally several more lines, each one preceded by a color rectangle (useful when displaying several polylines). -
Class
PhysUnits
to convert between "physical units" and array indices, useful for axis annotation. -
Classes
Utils
andJsonUtils
providing useful helper functions. -
Basic usage of the package: see
example
directory.
Related packages #
smart_arrays_base
: Basic functions for 1D and 2D arrays
smart_arrays_numerics
: Numerics with 1D and 2D arrays
smart_arrays_compress
: Compress 1D and 2D arrays to a smaller size.
smart_arrays_dbstore
: Store 1D and 2D arrays along with metadata on the local device.
smart_arrays_peaks
: Detect peaks in 1D and 2D arrays.
smart_lorentz_gauss
: Compute Lorentz-Gauss (pseudo-Voigt) line shapes.
smart_signal_processing
: Fourier transform and more of arrays.