Comments (5)
Considerations:
- Enlisting help from the likes of Jenn Brown to populate content, who's used to entering all necessary information into a single Google sheet per project across SVGs like noaa-onms/sanctsound:
-
Functionality of CINMS for all future use of infographiqJS:
svg
: explicit mention here allows for multiple SVGs in the same table to be associated with links to modal windowsid
->icon
: per SVG icon identifiertitle
: populates the modal titlelink
: specifies destination of clicking icon or toc.- If exists, then the destination URL is constructed by
{modal_url_pfx}
+{link}
is made explicit so you can have all kinds of scenarios, like: 1) different icon names go to the same modal content; or 2) maybe the same icon names in different SVGs go to the same modal content. - If this column is missing in the CSV, then presume a simpler fk-esr-info method whereby the link to the modal window is constructed by
{modal_url_pfx}
+{icon}.html
. - In the above scenarios,
modal_url_pfx
could be:""
: empty, so use just{link}
or{icon}.html
;{link}
would then be able to serve modals from full URLs from entirely different locations (eg Github repos, etc)."./modals/"
: a common folder, so can drop that part from the{link}
"https://noaa-iea.github.io/fk-esr-info/modals/"
: a full external URL prefix common across modals, such as for fk-esr-info modals hosted on Drupal CMS
- If exists, then the destination URL is constructed by
not_modal
: allows for clicking to a new page (vs opening the modal content), such as going from CINMS Ov`rview to a habitat like Kelp Forest
Now maybe we could have some default functionality or argument values to not require fields like:
svg
: excluding in the table, defaults to apply to any icon without filtering by svgnot_modal
: excluding in the table,
And what about these arguments in infographiqJS link_svg()
?:
modal_url_pfx
: This prefix is a hack to prepend a full URL (such as for Drupal IEA), but it would then apply to ALL modal links. Default to blank""
or NULL.modal_id
: 'modal'
This defines the HTML id of the modal html content to be update when clicked. The modal html is created in
infographiq.js#L18 but hardcoded and
gets updated in infographiq.js#L216-L226 with the variable value. Let's drop the argument and hard-code throughout for simplicity.
FYI @superjai, @mspector13
from infographiqjs.
Hey @superjai, @mspector13 - job completed. I have modified the infographic javascript to make the changes listed above. I have also ported all of cinms to reflect the new javascript as well as the new R organizational structure.
I have also made changes to the organizational structure of the two R repos, with a recommendation that one of the repos (infographiqR) be deleted (details in this issue).
Details to changes to the link_svg function in the infographiq.js file:
- Lots of error checking added, with error messages going to browser console, so that future failures in link_svg will be easier to fix. For example, if any of the four required parameters for
link_svg
are not defined, that is reported as an error message. csv_rows
added as an optional parameter. This parameter allows a subset of rows to be selected from the csv for the generation of the infographic (based upon rows with matching values in the optional svg column of the csv).- Hyperlinks for modal windows made much more flexible. Here are the options:
- If link provided in csv for modal window, that is used as link.
- If no link provided in csv for modal window, code uses icon name as link name for modal window
- If
modal_url_pfx
is defined, that then the link ismodal_url_pfx
+link
not_modal
is an optional value pulled from the csv filemodal_id
: this parameter has been removed from the function with the parameter value of 'modal' hard-coded instead
from infographiqjs.
I'm seeing the suggestion that all 4 arguments are required, otherwise get "ERROR" in
infographiqJS/libs/infographiq_latest/infographiq.js
Lines 26 to 33 in 173afd2
Ideally, we only require these two arguments:
-
svg
-
csv
Then these could be optional parameters:
-
svg_id
= "svg" -
toc_id
= "toc"
from infographiqjs.
-
csv_rows
-(rename)->svg_filter
: value to filter the columnsvg
by rows in the tablecsv
for subsetting the icons to link ; default is NULL so all rows are used
from infographiqjs.
Hey @bbest: finished.
- Requested changes to infographiq javascript made
- Functions moved from onmsR to infographiqR
- Cinms repo updated
from infographiqjs.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infographiqjs.