define Geom class hierarchy skeleton (no behavior change)#321
Draft
AviraL0013 wants to merge 1 commit intoanimint:masterfrom
Draft
define Geom class hierarchy skeleton (no behavior change)#321AviraL0013 wants to merge 1 commit intoanimint:masterfrom
AviraL0013 wants to merge 1 commit intoanimint:masterfrom
Conversation
Author
|
Hi @Faye-yufan @tdhock! Started fresh from master as suggested. Pushed the initial skeleton with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR initiates the refactoring of the monolithic
draw_geom()function ininst/htmljs/animint.jsinto a structured, object-orientedGeomclass hierarchy.This work builds upon the foundation started by @Faye-yufan in PR #107, I am restoring those architectural decisions and extending them to cover missing geoms (
GeomTallrect,GeomWiderect,GeomRect).Architectural Changes
I have introduced a base
Geomclass and two virtual classes to handle the core data-binding distinction inanimint2:Geom(Base): Handles shared logic for panel identification, SVG selection, and scale lookup.GroupGeom(Virtual): Designed for geoms likepath,line, andpolygon(data_is_object: true). These geoms require the "kv-based" data-bind trick to bind one SVG element to a group of data rows.UngroupGeom(Virtual): Designed for standard geoms likepointandsegment. These bind data row-by-row (one SVG element per data point).Concrete Subclasses Implemented (Skeleton):
GeomSegment,GeomLinerange,GeomVline,GeomHline,GeomText,GeomPoint(Restored from Faye's design)GeomTallrect,GeomWiderect,GeomRect(New additions)Purpose and Future Work
This refactor is a critical architectural prerequisite for:
get_domain()method to return its visible data range.d3.geoPathwithin a dedicatedGeomPolygonclass.