GithubHelp home page GithubHelp logo

conrod_graph's Introduction

Conrod Graph

conrod_graph is a collection of widgets for conrod that ease the creation of graphs. It was inspired by the Qt Custom Plot library.

How to use

Screenshot of application with graph

At the moment, conrod_graph only supports drawing line graphs. The graph accepts a Fn(f64) -> f64.

fn set_ui(ref mut ui: conrod::UiCell, ids: &Ids) {
    use conrod::{widget, Positionable, Sizeable, Widget};
    use conrod_graph::LineGraph;

    // Set up canvas
    widget::Canvas::new()
        .set(ids.canvas, ui);

    // Creature a graph from x: [-1.0, 1.0] and y: [-1.0, 1.0]
    LineGraph::new(-1.0, 1.0, -1.0, 1.0)
      .add_line(Box::new(|x| f64::sin((x + 1.0)*std::f64::consts::PI)))
      .parent(ids.canvas)
      .middle()
      .wh_of(ids.canvas)
      .set(ids.graph, ui);
}

conrod_graph's People

Watchers

 avatar  avatar  avatar

conrod_graph's Issues

Guide to running example needed

A guide to how to build and run the example would be useful in the readme.

EDIT: I managed to get the example to compile, but I get this error when compiling:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "GL context creation failed"', ../src/libcore/result.rs:788
note: Run with `RUST_BACKTRACE=1` for a backtrace.

With some looking around, this issue servo/servo#9585 appears to be similar. it appears that my computer does not have a new enough OpenGL driver to be able to run Glutin. :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.