Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import and refactor code from source @olange/h3-minimap Observable notebook #19

Open
11 of 12 tasks
olange opened this issue Apr 28, 2022 · 0 comments · Fixed by #1, #20 or #27
Open
11 of 12 tasks

Import and refactor code from source @olange/h3-minimap Observable notebook #19

olange opened this issue Apr 28, 2022 · 0 comments · Fixed by #1, #20 or #27
Assignees
Labels
‹focus› Our current focus user story New feature or request

Comments

@olange
Copy link
Owner

olange commented Apr 28, 2022

Import the base source code of the web component from our @olange/h3-minimap Observable notebook. Code will need some adaptations, as ObservableHQ is providing some features as part of its runtime:

Note

This should really be issue #1, but started its life as a Pull Request. As we cannot convert to an issue, I am creating it new at a late stage — and well, it became issue #19.

Actions

Import and essential adjustments (PR#1)

  • Bring-in all code from the source Observable @olange/h3-minimap notebook, which displays the geometries DONE 14.04 RF added projection selector and geometries: outlineGeom, hexesGeom, areasGeom, bsphereGeom, land; 27.04 OL removed projection selector
  • Remove the that argument from the mapViewOrSpinner() template helper DONE 27.04 OL+RF
  • Remove the _width and _height properties from the mapViewOrSpinner() template helper DONE 27.04 OL+RF
  • Have the spinner stay as long as the TopoJSON file has not loaded DONE 27.04 OL+RF
  • Replace the _aspectRatio internal property with the client size of the SVG canvas DONE 28.04 OL replaced with _svgClientRect property

More refactoring (PR#20, PR#27, PR#33)

  • Externalizes all views, projection and default settings to separate files DONE 28.04 OL
  • Replace getters with instance methods where applicable — isLoading does not have the semantic of a property; note many such getters were introduced for the geometries, anticipating that they would be calculated when needed and then cached, as they are expensive to create DONE 28.04 OL
  • Recast public members (getters and instance methods) as private where applicable — they otherwise appear in the documentation DONE 28.04 OL
  • Refactor the pathFn() and projFn() getters as derived properties, defined only when needed within willUpdate() (depending upon viewBoxSize getter and projection property)
  • Handle the fetchLandData() promise in firstUpdated() — may by with a Task controller, see reference articles below DONE 16.08.2022 OL PR Land geometry controller #33
  • Refactor requestAnimationFrame() in _measureSVGElement() as a reactive controller (which would introduce a firstPainted() lifecycle callback for instance, which would in turn call _measureSVGElement() and set this._svgClientRect) DONE 02.05 OL PR Adds firstLayout() lifecycle method and calls _measureSVGElement() #27
  • World geometry should re-render when either world-geometry-src|coll attributes change DONE 16.08.2022 OL PR Land geometry controller #33

Reference articles

  • Lit › Controllers › Use cases › Asynchronous tasks […] long running computations or network I/O, typically have state that changes over time, and will need to notify the host when the task state changes (completes, errors, etc.) […] @lit-labs/task contains a generic Task controller that can pull inputs from the host, execute a task function, and render different templates depending on the task state.

See also

@olange olange linked a pull request Apr 28, 2022 that will close this issue
5 tasks
@olange olange changed the title Retrofit code from source @olange/h3-minimap Observable notebook Import and refactor code from source @olange/h3-minimap Observable notebook Apr 28, 2022
@olange olange self-assigned this Apr 28, 2022
@olange olange closed this as completed in #1 Apr 28, 2022
@olange olange reopened this Apr 28, 2022
@olange olange added the user story New feature or request label Apr 28, 2022
@olange olange reopened this Apr 28, 2022
@olange olange added this to the Current focus milestone Apr 29, 2022
@olange olange added the ‹focus› Our current focus label Apr 29, 2022
@olange olange linked a pull request May 2, 2022 that will close this issue
@olange olange removed a link to a pull request May 2, 2022
@olange olange linked a pull request May 2, 2022 that will close this issue
@olange olange removed a link to a pull request May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment