All Projects β†’ elcritch β†’ plotex

elcritch / plotex

Licence: Apache-2.0 license
Elixir plotting utilities library

Programming Languages

elixir
2628 projects
HTML
75241 projects

Projects that are alternatives of or similar to plotex

Uplot
πŸ“ˆ A small, fast chart for time series, lines, areas, ohlc & bars
Stars: ✭ 6,808 (+9100%)
Mutual labels:  graphs, plotting
sr graph
A simple, one-file, header-only, C++ utility for graphs, curves and histograms.
Stars: ✭ 67 (-9.46%)
Mutual labels:  graphs, plotting
tmap
A very fast visualization library for large, high-dimensional data sets.
Stars: ✭ 146 (+97.3%)
Mutual labels:  plotting
chartjs-chart-graph
Chart.js Graph-like Charts (tree, force directed)
Stars: ✭ 103 (+39.19%)
Mutual labels:  graphs
Leetcode-solutions
Leetcode Grinder.
Stars: ✭ 14 (-81.08%)
Mutual labels:  graphs
SeaPearl.jl
Julia hybrid constraint programming solver enhanced by a reinforcement learning driven search.
Stars: ✭ 119 (+60.81%)
Mutual labels:  graphs
GraphIO.jl
Graph IO functionality for various formats.
Stars: ✭ 54 (-27.03%)
Mutual labels:  graphs
SurrealNumbers.jl
Implementation of Conway's Surreal Numbers
Stars: ✭ 30 (-59.46%)
Mutual labels:  graphs
deep-hyperedges
New Algorithms for Learning on Hypergraphs
Stars: ✭ 21 (-71.62%)
Mutual labels:  graphs
CondGen
Conditional Structure Generation through Graph Variational Generative Adversarial Nets, NeurIPS 2019.
Stars: ✭ 46 (-37.84%)
Mutual labels:  graphs
grandiso-networkx
Performant, pure-Python subgraph isomorphism and monomorphism search (aka "motif search")
Stars: ✭ 30 (-59.46%)
Mutual labels:  graphs
mfpb
My Frugal PostBin
Stars: ✭ 26 (-64.86%)
Mutual labels:  liveview
asyncmachine
Relational State Machine with a visual inspector
Stars: ✭ 67 (-9.46%)
Mutual labels:  graphs
Erdos.jl
A library for graph analysis written Julia.
Stars: ✭ 37 (-50%)
Mutual labels:  graphs
uncharted
No description or website provided.
Stars: ✭ 31 (-58.11%)
Mutual labels:  liveview
PyCORN
A script to extract data from Γ„KTA/UNICORN result-files (.res)
Stars: ✭ 30 (-59.46%)
Mutual labels:  plotting
mully
R package to create, modify and visualize graphs with multiple layers.
Stars: ✭ 36 (-51.35%)
Mutual labels:  graphs
Chia-Plot-Status
GUI Tool for beginners and experts to Monitor and Analyse Chia Plotting log files, show health and progress of running plots and estimated time to completion. No setup, configuration or installation of python or whatever required. Just install and enjoy.
Stars: ✭ 187 (+152.7%)
Mutual labels:  plotting
Introduction-to-Python-Numerical-Analysis-for-Engineers-and-Scientist
Introduction to Python: Numerical Analysis for Engineers and Scientist. In 2017, Python became the world's most popular programming language. This course covers the basic syntax, linear algebra, plotting, and more to prepare students for solving numerical problems with Python.
Stars: ✭ 110 (+48.65%)
Mutual labels:  plotting
graphframes
R Interface for GraphFrames
Stars: ✭ 36 (-51.35%)
Mutual labels:  graphs

Plotex

Pure Elixir library for producing simple plots time-series plots. Currently it only supports SVG which can be used Phoenix static or LiveView pages.

See units tests for more examples of producing SVG graphs. The SVG can be styled using CSS.

Changes

  • v0.4.0 Dropped CLDR builtin support for default Elixir Calendar and renamed a few things and bug fixes
  • v0.3.0 switch SVG generation to use markers -- should significantly reduce bandwith and svg elements
  • v0.2.2 fixed multi-graph support, added test output-dual.html
  • v0.2.1 added optional support for :cldr_datetime in addition to :calendar for datetime
  • v0.2.0 refactored some of the options
  • v0.1.1 added hex package
  • v0.1.1 has support for NaiveDateTime (easier to convert to user local time on the fly)
  • v0.1.0 has basic plotting functionality included

Features

Supports creating axis and scaling for both numeric and DateTime/NaiveDateTime series from Elixir Streams or Enums. Scaling and sizing can be modified with CSS used for styling everything else including font sizes.

Graph generation is designed to be modular.

Future Features

  • The API and handline of the plot gutters need to be polished
  • Better better support for changing aspect ratios
  • Legends
  • Add introspective abilities

Installation

def deps do
  [
    {:plotex, "~> 0.1.0"}
  ]
end

Example

defmodule ExampleSVG.Graph

  alias Plotex.Output.Options

  @doc " Create Plotex Graph "
  def plot() do
      xdata = [
        ~U[2019-05-20T05:04:12.836Z],
        ~U[2019-05-20T05:13:17.836Z],
        ~U[2019-05-20T05:21:23.836Z],
        ~U[2019-05-20T05:33:25.836Z]
      ]
      ydata = [0.1, 0.25, 0.15, 0.1]
      graph_data = {xdata, ydata}

      plt = Plotex.plot(
        [ graph_data ],
        xaxis: [kind: :datetime, ticks: 5, padding: 0.05] 
      )
      
      Logger.warn("svg plotex cfg: #{inspect plt, pretty: true}")
      
      plt
  end

  def render(socket) do
      plt = plot()
      
      # These options aren't really documented, but 
      # the plotex_test.ex contains most of the basic
      # usages. 
      svg_str =
        plt |>
        Plotex.Output.Svg.generate(
          %Options{
            xaxis: %Options.Axis{
            label: %Options.Item{rotate: 35, dy: '2.5em'}},
          width: 140,
          height: 105
        })
        |> Phoenix.HTML.safe_to_string()

      assigns = [svg_str: svg_str]

      ~L"""
      <html>
        <head>
          <style>
            #{Plotex.Output.Svg.default_css()}
          </style>
        </head>
        <body>
          <%= @svg_str %>
        </body>
      </html>
      """
  end
end

Example DateTime Output

Example DateTime Output Example Dual DateTime Output

Note, SVG uses a "graphics" coordinate system where the X-Y origin are centered on the top-left. Most graphing configurations assume the X-Y origin is in the bottom left. The SVG output adjusts this by setting the Y origin to range from -100..0 and adds a negative sign to the Y-data axis. This turns out to be the simplest general way to adjust the SVG origin.

TODO

  • The configuration API needs to be expanded upon.
  • Needs work in simplifying adjusting the axis gutter widths and adjusting the ratio (this works but is very manual).
  • Documentation!
  • Would like to remove the dependency on Calendar and TZData dependency.
  • PR's welcome.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].