Repository navigation
Conversation
|
Before merging this Hephaestus 0.5.0 needs to be released and ggsql needs to depend on that due to slight changes in where linetype conversion responsibility is located |
| ); | ||
|
|
||
| // Natural log - just verify non-empty | ||
| // Natural log over more than four e-folds: the powers of e alone. |
There was a problem hiding this comment.
IIUC this is putting breaks at powers of
| /// by spaces; Vega-Lite fills them with the evenodd fill-rule. Returns | ||
| /// `None` for unknown shapes. | ||
| pub fn shape_to_svg_path(name: &str) -> Option<String> { | ||
| let shape = zygos::patterns::shape::builtin_shape(name)?; |
There was a problem hiding this comment.
I'm a little bit confused, who owns the shape registry: zygos or hephaestus?
There was a problem hiding this comment.
zygos owns a registry of predefined shapes. This is a fixed list that hephaestus use to init it's own registry that can be expanded by the consumer
| .unwrap_or_default() | ||
| } | ||
| _ => derive(resolved_transform.default_minor_break_count()), | ||
| _ => match (major_interval, resolved_transform.temporal_unit(), extent) { |
There was a problem hiding this comment.
Just noting that this is currently hardcoded to a monday grid AFAICT, whereas in some cultures weeks start at sunday. Not important for the PR as a whole.
There was a problem hiding this comment.
yeah, at some point we have to decide how much we want locale to influence these kind of things
| ) -> Vec<f64> { | ||
| minor_breaks_symlog(major_breaks, n, range) | ||
| extent_minor_breaks(major_breaks, n, range, |min, max| { | ||
| symlog_minor_breaks(min, max, BREAK_BASE) |
There was a problem hiding this comment.
This is more of a taste comment intended for zygos rather than this PR, but I'd argue that in the 'range includes 0'-case the minor breaks are a little bit too dense near 0. Same for pseudo_log transform.
# Conflicts: # CHANGELOG.md # src/format.rs # src/parser/builder.rs # src/plot/scale/palettes.rs # src/plot/scale/types.rs
| /// `* => '...'` becomes the fallback template. Rename keys keep the | ||
| /// literal's type — `'A'` a string, `25` a number, `NULL` null — see | ||
| /// [`crate::format::key_value`]. | ||
| fn parse_renaming_clause(node: &Node, source: &SourceTree) -> Result<zygos::LabelSpec> { |
There was a problem hiding this comment.
Not necessarily touching the spirit of the PR, but while we're in here, can we lose the 'scale' bits of the error messages as these also now apply to table formatting?
| pub(crate) fn has_renaming(&self) -> bool { | ||
| !self.renaming.rename_is_empty() || self.renaming.template().is_some() | ||
| } |
There was a problem hiding this comment.
This is only used in 1 non-test place, so I'd question if this abstraction pays off
This PR moves as much scaling logic as possible to the new zygos crate so that ggsql and hephaestus can share it
Part of this work incidentally fixes #512