tgve / app Goto Github PK
View Code? Open in Web Editor NEWTemplate Repo
Home Page: https://tgve.github.io/app
License: MIT License
Template Repo
Home Page: https://tgve.github.io/app
License: MIT License
The GH deployment is stable. The only issue so far seems to be pushing to history
does not consider the homepage
entry in package.json.
Running the Flask instructions starts a webserver at http://127.0.0.1:5000 but going to that page fails:
See the Dockerfile for a reproducible example.
The obvious choices are to either:
cross-origin.md
instructionsSeems we have removed the env vars from the last build. App is deployed with no data source
The “dev” instructions in the README are incomplete and inconsistent with the “dev” instructions in eAtlas
, which also explains how to use eatlas-template
. We should consolidate, and ideally provide an executable example. We should also determine whether there need to be instructions for setting up just an application instance, with no dev capability.
tgvejs
, link to from app
eAtlas
README says file:
instead of link:
in package.json
– which is correct?Hosting your own instance
instructions in README.md
sed -i "s/tgve/${a[0]}/"
step fails (shouldn't match "@tgve/tgvejs
or tgver
script name)
json
tool instead of sed
to update homepage
onlyDelete this repo, moving the notebook example to full-app
along with the other Python examples.
full-app
to new python
folderjupyter-tgve.ipynb
to same folderrun.R
to R
folderfull-app
jupyter
repoUpdate package.json after repo name change
GitHub workflow is configured to only run on release
, which makes it hard to validate e.g. changes to package.json
.
release
pull_request
toofull-app
I remember when I presented this, it was not the case. Should it not run? Do we need to update the three steps with this?
When consolidating the documentation, I found information about how to run things via Flask in at least two different places (Wiki, plus full-app
README). These have been merged into the first section of serving-data.md, but it's not clear how they are related. These need to be further consolidated, at least if we want to continue supporting Python (if not we can just delete).
Dockerfile
to validate Flask instructionsREADME
in Python
folderREADME
into Dockerfile
, serve.sh
and tgve.py
cross-origin.md
instructionsREADME.md
tgve/app
nbval
test ❌ doesn't really work (see below)Unfortunately, the IFrame
encapsulates the image data, and in particular hides whether the URL actually resolves. Obviously there's more we could do here, but since accessing from Python isn't a priority use case, I'll consider those options out of scope.
Snapshot (approval) testing is useful for easy refactoring, and well supported by Jest. It's not quite trivial to set up for us because the map view renders asynchronously, and so waiting on "Nothing to show" doesn't seem to be enough for deterministic behaviour. The following diff illustrates different states that both satisfy expect(..).toContain("Nothing to show")
:
Maybe we can find a UI element to wait on that only appears when the map is fully loaded.
jest-image-snapshot
toMatchImageSnapshot
from jest-image-snapshot
and extend Jest’s expect
APIwaitUntil: "networkidle0"
tgvejs
(maybe no longer needed)hidden
(to avoid problem with async map content)__snapshort
folder as build artifactSee:
The instructions for hosting in R (via Plumber) should follow the same pattern as the Python instructions, i.e. be presented as reproducible scripts.
notes/serving-data.md
to R/README.md
Dockerfile
to Dockerfile.R
R/README.md
to plumber.R
, run.R
or Dockerfile.R
Dockerfile.R
through run.R
?run.R
-- subsumed by instructions in Docker.R
docker.yml
workflow to validate Docker scriptsAn RMarkdown file called reproducible.Rmd
should do what it says on the tin. Set up some CI to verify it, or delete it if no longer relevant.
rmarkdown::render("notes/reproducible.Rmd")
RCurl
install.packages("RCurl")
geoplumber
dependencyTest (inc e2e)
job to test against develop
branch of tgvejs
, rather than version installed from node
checkout
action for tgvs
needs repository: tgve/tgvejs
tgvejs
:
yarn install
(for e.g. babel
)yarn link
to register @tgve/tgvejs
yarn dist
(to ensure module exists)app
:
yarn link @tgve/tgvejs
to symlink to local tgvejs
yarn build-local
Test
and Test (e2e)
stepsTest
failing with “Invalid hook call” (React error 321)
yarn test
should not run e2e tests – only yarn test:e2e
yarn purge-tgvejs-react
to remove duplicate copy of React
/tgvejs/dist/index.js
) – just delete App.test.js
dumpio
in puppeteer.launch
release
branch only, after “Upgrade tgve.js” stepreset –hard
to undo “Upgrade tgve.js” step on puppeteer-experiment
branchrelease
PUBLIC_URL=
in Build [release]
stepTest (inc e2e)
job to test against develop
branch of tgvejs
, rather than version installed from node
Test (e2e)
failing with “Invalid hook call” (React error 321)
url.pathToFileURL(“build/index.html”)
to “http://localhost:3000/app”
side-pane-header
no longer exists (uh?) – rehash all selectors for now.side-panel-body-content > div > span
selector no longer works in last testyarn start &
in app
to Test (e2e)
step ❌ first test times out because of web server startupwait-on
and concurrently
yarn start
doesn’t return and causes “Test (e2e)” to hang
concurrently
with --kill-others –success last
❌ still fails with exit code--success first
app
and full-app
are identical, except that full-app
has the following additional files:
nodejs/server.js
R/plumber.R
run.R
Dockerfile
tgve.py
and tgve-cors.py
Notably, package.json
and gh-pages.yml
are identical, suggesting that the additional files could be harmlessly included into app
. (Someone uninterested in running via Docker can ignore the Dockerfile, someone uninterested in Python can ignore the Python files, etc.)
Including app
into full-app
as a submodule wouldn't work particularly well because we need the content at the root of app
to also be at the root of full-app
.
Python/jupyter-tgve.pynb
to app
full-app/README
to app/notes/hosting-data.md
hosting-data.md
from app/README
reproducible.Rmd
from tgvejs
to app
full-app
Test that app loads with a data URL. Arose from tgve/tgvejs#133.
Test
step in build-deploy
tgvejs
(default branch) and app
into separate child directoriesyarn build-local
to build and set homepage
to .
yarn start &
to start webappyarn test:e2e
to run@testing-library/jest-dom
, @testing-library/react
import ‘@testing-library/jest-dom’
in setupTests.js
jest-environment-jsdom-sixteen
; add --env=jest-environment-jsdom-sixteen
to react-scripts test
import { render, screen, waitFor }
from @testing-library/react
render
rather than renderer.create
from @testing-library/react
waitFor(() => { expect(..).toBeInTheDocument() })
pattern with ’Nothing to show’
?render
: use expect(asFragment()).toMatchSnapshot()
defaultURL
via <App />
?<?s>screen.getByText(’100 Rows’)
to be in documentfetch
in utils.js/fetchData
to work in test codeglobal.fetch
to return example JSON objectfails in
_fitViewportbecause
this.map` is null!this.map || ...
longitude
must be supplied in MapGL
component@testing-library/react
– render
method allows testing in simulated browser environment@testing-library/react
?react-test-renderer
– create
method allows testing against virtual DOMenzyme
– obsoletepuppeteer
– end-to-end (e2e) testing in headless browserReactDOM.render
?BrowserRouter
?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.