uw-macrostrat / column-builder Goto Github PK
View Code? Open in Web Editor NEWApps for stratigraphic column data acquisition. Also includes sql and bash scripts for altering a subset of burwell.
Apps for stratigraphic column data acquisition. Also includes sql and bash scripts for altering a subset of burwell.
Sometimes Dragging doesn't work because of what appears to be a difference in contexts server-side and client-side. There is a function resetServerContext()
from rbd, however it doesn't seem to work all the time. So for now, we only render the dragging tables on the browser.
This bug fix is already integrated into main, I just wanted to place this here for records.
I am starting to work on getting this installed + running myself. A few points:
There will be many more bug reports, I am sure, but this should be a good start. You should start developing new features as Pull Requests, to take advantage of the code review and acceptance processes here.
There are a few issues with the source code that I am worried about right now:
At https://github.com/UW-Macrostrat/column-infrastructure/blob/b23142e2fdf32cef771ef52966bb2df9307d6833/frontend/dacite/pages/strat-name/edit.ts#L19, you return from the function before running a React hook. This will create errors. You need to run all hooks before returning.
On many pages, the persistChanges
function has a fair bit of error handling boilerplate and often some path manipulations. Is there a way that this could be simplified and abstracted?
For the table views on the Column
and Section
page, the editors are too easy to dismiss and may lead to users accidentally erasing unsaved data. Although complete prevention is impossible we should make some changes to mitigate it as much as possible. For the in-table editor, disabling other user interactions may be enough. For other things, like reordering of units, it would be better to have a fail-safe for preventing loss on page navigation, like a modal that takes over the screen and points out unsaved data.
Now that @amyfromandi has joined us, we are preparing to reactivate development of this application to enable editing of stratigraphic columns.
This application prototyped several approaches that are now becoming standard in Macrostrat v2:
It is also a bit fragmented:
column-footprint-editor
application for managing column topologyMapboard/topology-manager
to solve topology (and a fairly old and inflexible version).I propose that we split the codebase to
macrostrat
repositoryweb
codebase, and migrate it from Next.js to Vike to match our current approachThis will allow us keep the app closely tied to the rest of Macrostrat's user-facing code and take advantage of our CI/CD, etc.
This iteration of the app is a fairly straightforward re-implementation of the original Dacite column editing tools (PHP). However, there are other approaches to editing columns. We've created some other prototype apps that might be worth borrowing from eventually (note, these are currently not running anywhere):
stratigram
: prototype image-oriented app for capture of measured sections (could be another view here)naukluft-app
: column editor focused on the specific case of a field project in NamibiaI think we should rename this to be slightly more restrictive โ how about "column-entry" or "column-builder"?
Stop punting on errors from API calls, it can lead to confusing interface states where it's unclear what is going on. It would be good to have some preliminary error boundary in the BasePage.
I have the following output when I try to build a Macrostrat database using the database/bin/dump-burwell
script. Basically, a lot of tables get created but a few are not found, notably macrostrat.projects
. This causes an error cascade of sorts and leads to an application that can't be initialized:
DELETE 68
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
DELETE 9
ALTER TABLE
UPDATE 23769
DELETE 0
ALTER TABLE
ALTER TABLE
ALTER TABLE
UPDATE 1
UPDATE 1
DELETE 2
ALTER TABLE
DELETE 33
ALTER TABLE
DELETE 1
ALTER TABLE
ALTER TABLE
DELETE 2
ERROR: relation "macrostrat.sections" does not exist
LINE 3: where section_id not in (select id from macrostrat.sections)...
^
ERROR: relation "macrostrat.sections" does not exist
ERROR: relation "macrostrat.sections" does not exist
ERROR: relation "macrostrat.strat_tree" does not exist
LINE 1: DELETE FROM macrostrat.strat_tree
^
ERROR: relation "macrostrat.strat_tree" does not exist
LINE 1: UPDATE macrostrat.strat_tree
^
ERROR: relation "macrostrat.strat_tree" does not exist
ERROR: relation "macrostrat.projects" does not exist
ERROR: relation "macrostrat.projects" does not exist
ERROR: relation "macrostrat.projects" does not exist
ERROR: column "project_id" of relation "col_groups" does not exist
LINE 2: SET project_id = c.project_id
^
Gathering arguments
Running database/bin/../db-alterations/02-remove-unused.sql on database
ALTER TABLE
Gathering arguments
Running database/bin/../db-alterations/03-primary-key-seq.sql on database
CREATE FUNCTION
CREATE PROCEDURE
INFO: Resetting Sequence for: macrostrat.col_areas (id) to 5355
INFO: Resetting Sequence for: macrostrat.col_groups (id) to 354
INFO: Resetting Sequence for: macrostrat.col_refs (id) to 9725
INFO: Resetting Sequence for: macrostrat.cols (id) to 5732
INFO: Resetting Sequence for: macrostrat.econs (id) to 24
INFO: Resetting Sequence for: macrostrat.environs (id) to 94
INFO: Resetting Sequence for: macrostrat.grainsize (grain_id) to 32
INFO: Resetting Sequence for: macrostrat.lith_atts (id) to 186
INFO: Resetting Sequence for: macrostrat.liths (id) to 214
INFO: Resetting Sequence for: macrostrat.lookup_units (unit_id) to 93480
INFO: Resetting Sequence for: macrostrat.measuremeta (id) to 1
INFO: Resetting Sequence for: macrostrat.places (place_id) to 88
INFO: Resetting Sequence for: macrostrat.refs (id) to 222
INFO: Resetting Sequence for: macrostrat.strat_names_meta (concept_id) to 43927
INFO: Resetting Sequence for: macrostrat.strat_names (id) to 108126
INFO: Resetting Sequence for: macrostrat.timescales (id) to 33
INFO: Resetting Sequence for: macrostrat.unit_econs (id) to 3158
INFO: Resetting Sequence for: macrostrat.unit_environs (id) to 127121
INFO: Resetting Sequence for: macrostrat.unit_lith_atts (id) to 104172
INFO: Resetting Sequence for: macrostrat.unit_liths (id) to 176068
INFO: Resetting Sequence for: macrostrat.unit_measures (id) to 105049
INFO: Resetting Sequence for: macrostrat.unit_strat_names (id) to 32155
INFO: Resetting Sequence for: macrostrat.units (id) to 93483
INFO: Resetting Sequence for: macrostrat.units_sections (id) to 91989
INFO: Resetting Sequence for: macrostrat.intervals (id) to 1688
CALL
Gathering arguments
Running database/bin/../db-alterations/04-misscel.sql on database
ALTER TABLE
UPDATE 27955
Gathering arguments
Running database/bin/../fixtures/01-views.sql on database
CREATE SCHEMA
ERROR: relation "macrostrat.projects" does not exist
LINE 2: SELECT * FROM macrostrat.projects;
^
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
ERROR: relation "macrostrat.strat_tree" does not exist
LINE 2: SELECT * FROM macrostrat.strat_tree;
^
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
ERROR: relation "macrostrat.sections" does not exist
LINE 2: SELECT * FROM macrostrat.sections;
^
CREATE VIEW
CREATE VIEW
ERROR: column cg.project_id does not exist
LINE 5: cg.project_id,
^
HINT: Perhaps you meant to reference the column "c.project_id".
CREATE VIEW
CREATE VIEW
CREATE VIEW
CREATE VIEW
ERROR: column u.notes does not exist
LINE 16: u.notes,
^
CREATE VIEW
ERROR: column c.notes does not exist
LINE 6: c.notes,
^
When setting the lat/long point it also needs to set the point coordinate for the column as well.
The state managing which row is editing and the actions for copying units up and down has become too complicated as I layered on different editing modes. Now that we're back to a simpler model, the state management should also be simpler.
The useRowEditor
is unnecessarily complicated and should be wrapped into the reducer.
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.