kneitinger / nightgraph Goto Github PK
View Code? Open in Web Editor NEWAn interactive, low-boilerplate creative coding platform
License: MIT License
An interactive, low-boilerplate creative coding platform
License: MIT License
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
Currently nightgraphics
' Shaped
triat has a difference
operation. In addition to that it should have union
and intersection
.
union
operation to Shaped
traitintersection
operation to Shaped
trait (this very well might share a lot of code with difference
)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?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.
All crates should have thorough READMEs that explain their purpose, how they're used, and if applicable technical details
nightsketch_derive
: should explain all of the code that #[sketch]
generates, and the attributes/optionsnightsketch
: should explain how to add a sketchnightgraphics
: 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 listCurrently, by zooming in to a drawing, the zoom point is the center of the canvas. It would feel far more natural to zoom to the point underneath the cursor.
At least 80% test coverage in repo.
nightsketch_derive
macro internalsnightsketch
features (testing clap derivations, etc)nightgraphics
geometry/canvas/render coverage improvementnightgraph-ui
custom components (sketch loading, parameter control generation, etc)I don't believe sketches themselves make sense to include in this figure
Currently, nightgraph-cli
saves the rendered SVG as image.svg
in the current working directory. This should obviously be able to be set by the user at runtime.
Eventually, a stronger system of timestamped files/dirs and stored argument metadata should be implemented so that all images are reproducible. An issue should be filed for that when this issue's fix is in place.
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.
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.
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.
There are currently 3 places assets live:
ui/assets
for GUI fontsgraphics/assets
for nightgraphics::geometry::TextBuilder
built-in fontsimg
for README/doc images)Combining these into an assets
directory with subdirectories for fonts
, 'imgs`, etc would be a nice thing to do :)
Base issue for general logging related tasks
nightgraphics
nightsketch{_derive}*
nightgraph-ui
nightgraph-cli
nightgraph-cli
as well as clap
options for verbositynightgraph-ui
with option to specify verbosity. Filtering/searching would be nice as well!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.
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
clippy
and rustfmt
wasm
toolchains in addition to x86_64
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.
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).
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.