Giter Club home page Giter Club logo

nightgraph's People

Contributors

kneitinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nightgraph's Issues

Audit errors/error handling

Currently each lib has decent error types, but their clarity/usage/etc. is inconsistent. All crate/mod error types should be reviewed and refined, and every occurrence of unwrap() should be checked and replaced unless completely certain a case is infallible.

Once the errors are refined, nightgraph-cli and nightgraph-ui should report errors cleanly to the user. ui can have an error console, or use the tab/panel/etc described in #6

Boolean geometric operations

Currently nightgraphics' Shaped triat has a difference operation. In addition to that it should have union and intersection.

Tasks

  • Add union operation to Shaped trait
  • Add intersection operation to Shaped trait (this very well might share a lot of code with difference)
  • Consider returning a Result as some operations do not make sense. For example, what does a the difference of 2 non-closed shapes imply? What about the union of a circle and a line?

All Shapes should have `Builder` structs

With the addition of optionally-precomputed bounding boxes, and specifiable stroke widths (#25) the configuration options for a shape are getting quite numerous.

Following the lead of PathBuilder and TextBuilder, all shapes should have an associated builder, and if appropriate, a central shape builder that can instantiate any shape might be nice.

Populate READMEs

Overview

All crates should have thorough READMEs that explain their purpose, how they're used, and if applicable technical details

Tasks

  • nightsketch_derive: should explain all of the code that #[sketch] generates, and the attributes/options
  • nightsketch: should explain how to add a sketch
  • nightgraphics: as the most potentially externally useful crate, it should explain an overview of features, some example snippets, some design philosophy, etc.
  • nightgraph-{ui,cli}: build instructions (including wasm), screenshots, usage, feature list

Expand unit test coverage

Goal

At least 80% test coverage in repo.

Tasks

  • nightsketch_derive macro internals
  • #19
  • nightsketch features (testing clap derivations, etc)
  • nightgraphics geometry/canvas/render coverage improvement
  • nightgraph-ui custom components (sketch loading, parameter control generation, etc)

Note

I don't believe sketches themselves make sense to include in this figure

Sketches should be selectable in nightgraph-ui

Currently, nightgraph-ui can only load/modify/render the "Blossom" sketch, regardless of how many sketches exist. nightgraph-cli can select from a list of sketches, since clap derives them into subcommands, so this only is relevant to ui.

Due to the previously mentioned clap subcommand functionality, the sketches are stored in an enum where each variant is of the form SketchName(SketchStruct) (i.e. Blossom(Blossom)). This could work for the ui, but there is a lot of maintenance overhead to add a new sketch, and there isn't a clean discoverability method.

According to the proc_macro reference docs, attribute macros (such as the #[sketch] macro already in nightsketch_derive) can apply to external blocks. Perhaps that implies that by adding an attribute to the various sketches' use statements, a low-interaction solution can be constructed/derived.

Render to SVG from nightgraph-ui

Overview

Currently, there is no way to save modified sketches from the UI other than taking a screenshot (lol).

The UI does have access to the resulting Canvas of a given sketch, so instead of calling EguiRenderer::render_egui to render the UI's view of the sketch, we can call SvgRenderer::render_svg.

The currently implementation of render_svg unconditionally saves the resulting SVG as image.svg in the current working directory. render_svg should be modified to either return the SVG as bytes, or take a path arg.

Unknowns

I do not know if egui has any file saving widgets already, and furthermore, if they exist, how they function in a wasm context. Any solution to this issue must work in both native and web apps.

Consolidate assets directories

There are currently 3 places assets live:

Combining these into an assets directory with subdirectories for fonts, 'imgs`, etc would be a nice thing to do :)

Logging!

Overview

Base issue for general logging related tasks

Tasks

Logging statements

  • Add logging statements to nightgraphics
  • Add logging statements to nightsketch{_derive}*
  • Add logging statements to nightgraph-ui
  • Add logging statements to nightgraph-cli

Loggers

  • Add console (and optionally file?) logging to nightgraph-cli as well as clap options for verbosity
  • Add logs widget/pane/tab to nightgraph-ui with option to specify verbosity. Filtering/searching would be nice as well!

Warn on missing descriptions for sketches and sketch params

nightsketch_derive creates descriptions from doc comments or outer attributes and uses those for -h text in nightgraph-cli and (eventually) mouse-over text in nightgraph-ui. Due to how helpful these are, nightsketch_derive's macros should emit a warning if a sketch or param is missing a description.

Create parameter groups and "important" parameters in `nightgraph-ui`

When using many parameters in a sketch, the UI's parameter tab can get a bit cluttered. To relieve this,

it would be nice to allow parameters to be grouped, for example the parameters for a sine wave being next to each other and padded from others with a separator...or even all of them being in an egui CollapsingHeader

Even easier, it would be helpful to allow parameters to be tagged as important (or some similar and shorter word) and appear in the parameter panel as bold text

#[param(default = 3, important)]
sine_wave_count: u32

CI Improvements

A collection of tasks that would make CI more effective

  • Rust tests can be skipped if a commit only touches README files
  • Rust tests should run clippy and rustfmt
  • Rust tests should cache dependencies, and build artifacts if possible Fixed by eb3d06f
  • Rust tests should run on wasm toolchains in addition to x86_64

Allow sketch text fields to be ui/cli params

The #[sketch] attribute macro in sketch_derive will currently autogenerate clap/custom code for setting integral, floating point and boolean values. A lot of my recent work uses text, and having that be a cli option or UI setting would be great.

The general infrastructure for this is already in place; the main hurdle is just handling lifetimes/ownership with aggregate datatypes.

For cli settings, quotations handle any whitespace/newlines. For UI, this setting should likely be a multiline text box.

Bundle nightgraph-ui with a monospace font, and disable built-ins

Overview

nightgraph-ui already bundles the Jost font for regular text, but uses the default egui font for monospace. A visually pleasing and open licensed monospace font should be bundled into nightgraph-ui, and the eframe/egui/epaint default_fonts feature should be disabled (note: it is part of the default features of those crates).

`nightgraph-ui` sketch parameteres should be able to be reset to default values.

A reset button should be present in the "Sketch Settings" collapsible heading section that returns zoom, and all parameters to their defaults.

Currently, defaults are not communicated to the UI, so nightsketch::metadata::ParamMetadata should have a default value field added, or functions should be provided that return the default val by id, like how getting/setting currently works.

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.