canon

Reusable React environment and components for creating visualization engines.

GPL-3.0 License

Downloads
1.4K
Stars
27
Committers
19
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • removed unused react-hot-loader (87eccd03)
  • fixes prod builds (2013624c)
  • downgrades postcss-custom-properties to 6.3.1 (93903757)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • downgrades postcss-custom-properties to v7 (11b2ed65)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • fixes bug with core-js version mismatch (ead2b678)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • removes activePath from webpack printout to make line shorter (b2cd47bc)
  • updates postcss packages (c303e2b5)
  • updates to the latest babel for IE fix (b9cb5864)
  • adds window location information to readme (b73025f6)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • removes usage of this.props.location (5405b69d)
  • adds mondrian-rest-client dependency (5ee1da23)
  • simplifies cubes env var sanitization with regex (dad0015a)
  • relies on location rather than transition for pathname (a3b245a7)
  • fixes bug with permalink routing in cms (44116382)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

🔥Breaking Database Changes! 🔥

Several DB changes have been made that are incompatible with past versions of the CMS.

  • Topics have been renamed to Sections
  • Sections now have a column named sticky for scroll-resistant sections
  • Selectors now belong to Profiles, and Sections subscribe to Selectors

Upgrading to this version will require a (forthcoming) import script for old CMS DBs.

Issues Closed

  • Moves generators, materializers, selectors, and formatters to a new sidebar called the Toolbox, avoiding the need to change view to the top-level profile to make changes to these elements (closes #529)
  • Selectors no longer belong to individual sections - they are top-level entities that belong to profiles. Individual sections now "subscribe" to these global selectors (closes #562)
  • Renames "topics" to "selectors" at all application levels (closes #561)
  • Adds a "sticky" toggle for sections, allowing for them to stick to the page while scrolling, until the next "sticky" section scrolls by (closes #563)
  • The topic (now section) endpoint has been removed entirely, replaced with a unified /api/profile endpoint (closes #516).

New API Format

There is now a single unified /api/profile endpoint, which receives all options via query parameters.

The usual way of retrieving a profile via GET, with a list of slug/id pairs, remains the same: /api/profile?slug1=geo&id1=Massachusetts&slug2=cip&id2=Metalworkers.

However, a POST endpoint has been added at the same endpoint, /api/profile, with the following properties:

  • The user must provide their own variables object in the post - the one that they received on page load.
  • The user must provide a profile id as a query param &profile=123 to return the entire profile, or a section id (for just a single section for embeds) &section=123 to return a single section instead of the entire profile.

So if the user changed a dropdown on the page, the new profile request might look like this (pseudocode):

const {variables} = this.state  // saved from initial load
const {id} = this.state.profile   // saved from initial load
const {someSelectorState} = this.state;   // received from onSelector change
const selectorString = makeQueryParamsFrom(someSelectorState);
const url = `/api/profile?profile=<id>&${selectorString}`;
const payload = {variables};
axios.post(url, variables).then(resp => this.setState({profile: resp.data});

Other improvements

  • Adds ability to search the Toolbox by variable name, and directly open the generator or materializer that created it
  • Updating generators in the CMS only fetches the data for that single generator, improving performance by skipping a full reload
  • Unifies TextCards to contain both languages side by side for easier translation
  • Changing the state of selectors actually properly renders and previews the content
  • Select Canon vars, and all CANON_CONST_* are available to use in generator APIs (e.g., CANON_CONST_MYVAR can be used in a generator API with /api/?var=<MYVAR> (for you @cnavarreteliz)
  • Automatically opens generators and materializers on creation
  • Innumerable wonderful UX improvements by the incomparable @perpetualgrimace

Full Changelog

  • removes console.log (5ebb58e4)
  • suppresses allowed dropdown from top-level profile/section cards (3ac11b61)
  • handles SelectorUsage states (no selectors, no inactive selectors, no active selectors) (f7cac761)
  • rolls back green-highlighting changes, need to revisit (64216de6)
  • fixes filtering for #570 (459cfaaf)
  • replaces generic buttons in Header (703fcea0)
  • styles varSwap'd vars (7c9199c6)
  • replaces sticky toggle checkbox with button group (#563) (a1860b7f)
  • keeps DefinitionList labels from wrapping (44a4b25f)
  • scales down URL font size for long URLs in Header (921100b7)
  • fixes unintentionally invisible elements (8f0cbe1c)
  • adds sticky prop to tree for potential styling (b69d79b1)
  • adds ability for sections to be 'sticky' (d924341e)
  • cleans up const declarations (7726793b)
  • auto-opens gens/mats on creation (bf3dfef4)
  • changes forceOpen logic to make room for auto-open improvements (756dadb2)
  • handles cases of missing default content more smoothly (542895c7)
  • refactors topics to be called sections (c3a4fc93)
  • moves components broadly concerned with constructing the admin panel to an interface folder (fc718cf8)
  • moves components related to the formatting and display of variables into a variables folder (a4ec6045)
  • deletes empty SelectorPreview file (716a4fe7)
  • renames CardWrapper to Card (65a77f9a)
  • moves ReorderButton to cards folder (3d7343f4)
  • tweaks locale margin (e637fbc7)
  • renames classNames (and a few props) from topic to section (b20d202e)
  • renames Panel (formerly Section) to Accardion (a22c0faa)
  • begins reorganizing components (7264a6d8)
  • adds canon_const_* vars to urlswap for generator apis (2c069505)
  • adds framework for previews in permalinks (disabled currently) (527bdae5)
  • fixes pathing bug (a291c2cf)
  • fixes red screen on topic click and fixes reload on permalink (77beafff)
  • renames topics to sections in filesystem (2b99ad57)
  • fixes render bug with header labels (b06b28b4)
  • adds rudimentary permalinks to cms (991079bc)
  • adds abiltiy to specify a materializer in variables endpoint (49aa6800)
  • hacks in side by side TextCard style (476fa4b9)
  • adjusts TextCard dialog to account for one language or two (b443a95e)
  • fixes none status (291e990f)
  • fixes selecting none in lang selector bug (44fab72a)
  • styles multilingual TextCard dialog (49724ee5)
  • fixes this/that lang bug (be1d9353)
  • unifies text cards for profile (c8c89cd3)
  • unifies textcards by lang (23144dfe)
  • removes button/ability to delete titles (they can't be deleted) (7702e4a3)
  • reorganizes Header markup so that the button can appear outside of the link (8b83cb4c)
  • refactors node labeling to allow for selectors in tree sidebar (49958835)
  • decreases randomness of key ids in toolbox (ee8e15ea)
  • adds more accordion behavior to ProfileBuilder tree (82ebbc89)
  • stops unique key warning, are you happy now 💁‍♀️ (e30c9755)
  • moves mgmt of selectors out to profilebuilder so changes reflect in selectorUsage (d65866bc)
  • adds slug & slug edit button to Header (0b6a27e1)
  • adjusts card padding (d1d8f158)
  • removes now-unnecessary margin from toolbox (3f156de1)
  • styles header (474b6833)
  • fixes filename case inconsistencies (59e4c88d)
  • handles Header profile links when no dimensions are selected (c4d77286)
  • adds profile header with title & link (WIP) (cc205542)
  • cleans up toolbox output view (WIP) (d400a598)
  • removes fetchvariables callback from topiceditor (689ddb9a)
  • fixes bug with changing tabs between selectorUsage (70f53b0d)
  • fixes bug on front end so all topics subscribe to all selectors (2d0d8240)
  • fixes bug with topics not subscribing properly to selectors (f9f4e282)
  • adjusts dimension card layout (4a7e9ed0)
  • forks Search & FilterSearch into new PreviewSearch, implements DimensionCard redesign (4e767fa7)
  • fixes white screen bug with DefinitionList and converts it to...well, to an unordered list, because styling ¯_(ツ)_/¯ (0e407c06)
  • makes generators not need to hit entire api set, returns single (fe83c949)
  • fixes white screen bug closes #546 (fa6bc7ac)
  • styles SelectorUsage (d46e7dac)
  • rearranges mortar get/post logic (f7514368)
  • adds catches for objects in selectors (d5c4b88d)
  • fixes git screwup from merge (f5c440ec)
  • updates front-end to handle new profile-wide selectors (aaf405af)
  • renames SelectorPreview to SelectorUsage, begins styling (7018797f)
  • removes unused packages (e85c2db4)
  • fixes bug in selector preview that prevented page updates on select (858f43c0)
  • removes old topicReq (8b970c29)
  • styles selector editor (e80b9c49)
  • fixes && rendering 1 when varList is empty in SelectorCard (c46b57d1)
  • updates onSelector in topic.jsx to work with new style (3823f79b)
  • removes topic endpoint and rolls into new master profile get/post endpoint (71eda033)
  • changes profile endpoint to allow POST with variables (24542d91)
  • adds VarList, styles SelectorCard (fdb24fad)
  • swaps out selector selector selects for Selects (00cc4171)
  • styles Select component, adjusts settings menu (49ffa73b)
  • adds Select component (e0db2f20)
  • adds DefinitionList component, begins styling SelectorCard (eb66ab1c)
  • fixes minor VarTable visual bug (dcb1935d)
  • accounts for multiline VarTable error text (b3d37e76)
  • cleans up VarTable, fixing weird styling issues, adds boolean ConsoleVariable type (88ef1f07)
  • hooks up external delete buttons (0725396a)
  • shows proper label on selectorcard dropdown (81fa0715)
  • hides section header add buttons when collapsed (ffd65943)
  • converts card edit button to cover button; closes #567 (8fab866d)
  • fixes bug where select changes would update multiple drop downs (0c31bbf4)
  • removes console log (e8cb21c2)
  • adds callbacks for selectorpreview cards (e80fdcc6)
  • prevents nonfunctional add selector button (bae934dd)
  • tweaks selector editor "active" language and controls (4fd73a4b)
  • adds selector to list of toolbox entities (1c276d00)
  • creates rudimentary selector preview (e1d1f1bc)
  • fixes topic endpoint bug, h4 nesting, and propmap lookup in topiceditor (5120749e)
  • adds settings button & dropdown (96a6676e)
  • fixes react key error (068d89bd)
  • simplifies visibility switches (2ae31385)
  • fixes bug in ordering selectors (1406366c)
  • adds id to topic_selector and creates new selectorcard mode (fca53ae6)
  • adds selectors to toolbox (e5dd9dae)
  • refactors selectors to belong to profiles (60879776)
  • always shows the toolbar add button & hides the big add button in toolbox sections (9e47d729)
  • styles add first entity button in toolbox (872b47db)
  • formats panel metadata sections consistently (fef1108c)
  • hacks in accordion behavior (6c6c8332)
  • hacks in new card design (c27a396c)
  • tweaks card style (d2ac6e18)
  • adjusts button group style (861f68c1)
  • simplifies card layout and reorder button; adds delete/edit button group to cards (09da622c)
  • converts filter search to a component and styles it (1fccbba3)
  • adds button group component (04eb61ad)
  • hides entire gen/mat/form windows on zero search results (c80a178c)
  • unifies filter function (b72bf955)
  • removes formattereditor and places it directly in toolbox (5cf88ca5)
  • removes tree node auto collapsing because the parent node closed when clicking a child node 😅 (94ab310f)
  • makes SidebarTree nodes auto expand and retract (dff003d0)
  • begins styling toolbox; adjusts logic in prepartion for collapsable sections (4337f98d)
  • styles status indicator like a toast (8b63df13)
  • adds a bit more fudged tree styling (6c9a0702)
  • makes toolbox load in more gracefully (7431d85f)
  • makes various minor theme tweaks (1c133e04)
  • hunts down a few manual dark mode media queries and replaces them with the mixin (a026adf0)
  • hacks the add profile/story button into place (ba83ceab)
  • styles button disabled state (bdfc94b5)
  • updates button style (df18a078)
  • styles the tree (WIP) (5ba5e1c3)
  • fixes bug in filter search and adds lowercase catch (3b842283)
  • begins styling navbar (bd9d95a8)
  • moves formatters to toolbox (95873005)
  • moves search bar into generic filter bar (7ed9a23d)
  • rebalances grayscale color palette (ef77d317)
  • removes soon to be unused button styles (d0f201c9)
  • adds quick and dirty responsive layout for toolbar (7fe79b72)
  • adds toolbox dark theme background (52bc1890)
  • set toolbox max-height & overflow; enables inertia scrolling for overflow containers (4c97ab9d)
  • adds filter box to varlist (c59996c7)
  • shows and hides generators in toolbox (07316cec)
  • adds lookup table for vars (bfb74e50)
  • refactors generator placement for toolbox (2f14ec08)
  • adds toolbox sidebar (2ab6d1b7)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • adds optional debug pass-through (fb55e255)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

BREAKING Updates dependencies to use canon-core v0.17, react v16, and blueprint v3.

  • updates package-lock (1fc3d75a)
  • updates dependency list (b43d5765)
  • reenables measure tableid on allmeasureselect (077613a3)
  • fixes bug on headings for allmeasureselect (e48ceb6a)
  • reimplements custom selects with blueprint3 api flattens sidebar component folder (26885176)
  • comments out interactionKind so popover will show (82235677)
  • fixes key error in popover (4021615a)
  • updates popover props (41f34996)
  • changes iconName to icon and adds key prop for dom element (cabde794)
  • updates packages (a95ace9d)
  • adds blueprint select package (ba9d11b3)
  • updates bp3 import paths (a15fda61)
  • replaces pt- with bp3- (c387dbc7)
  • updates package to blueprint 3 (1de53855)
  • updates package-lock (0087f614)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • adds formatting function to x axis on barcharts closes #557 (3935b4b8)
  • adds a toast if the resulting dataset is empty closes #558 (47a70842)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • renames section.css to Section.css (5bf1ec2)
  • adds example env file (0c016af)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • coerces variables to strings before attempting regex (5edd5f2)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • fixes initial confidence value for lineplot and only sets it if user has enabled it (5a3c314)
  • changes testing datausa link (03e3173)
  • updates deep d3plus dependencies (0d21901)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • remove warning fixed #551 (e37dd09)
  • adds case insentive regex symbol (08be4d8)
  • adds new url-loader file extension (06e8702)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • allows commas followed by spaces in cut IDs (273868c)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

This release includes a new node script, migrate-db, which can be used to turn a 0.1 cms (Data USA or CSC) into a modern (0.6.x bivariate) db structure.

To migrate, Configure the "old" and "new" databases using the following env variables:

CANON_CONST_MIGRATION_OLD_DB_NAME
CANON_CONST_MIGRATION_OLD_DB_USER
CANON_CONST_MIGRATION_OLD_DB_PW 
CANON_CONST_MIGRATION_OLD_DB_HOST

CANON_CONST_MIGRATION_NEW_DB_NAME
CANON_CONST_MIGRATION_NEW_DB_USER
CANON_CONST_MIGRATION_NEW_DB_PW 
CANON_CONST_MIGRATION_NEW_DB_HOST

then run npm run migrate-db, and wait for the Done. message.

⚠️ IMPORTANT ⚠️ The migrate-db script is configured to DELETE all content on the new db on every run - resulting in a fresh, complete migration on every run of migrate-db. DO NOT point the MIGRATION_NEW variables to a database that you do not want to completely destroy.

This branch also includes a few cms-level enhancements that will better handle the special cases of DataUSA, so it's important that we merge this into DataUSA mainline as part of the ongoing migration.

Closes #515.

Full Changelog

  • Merge pull request #555 from Datawheel/issue-515-migration (7820239)
  • Merge branch 'master' of http://github.com/datawheel/canon into issue-515-migration (0f76871)
  • adds catch for potential datausa bugs (bd3a938)
  • fixes search results bug that would break datausa upgrade (3ae19a4)
  • fixes bug in migration and handles case of missing levels better (69b1391)
  • pulls in master (b3e538a)
  • updates package lock (b16748b)
  • fixes bug with section title (672c682)
  • works around null levels in attr search (7e6121b)
  • Merge branch 'master' of http://github.com/datawheel/canon into issue-515-migration (977db62)
  • fixes bug in formatter xfer and adds story migration (2c111cd)
  • fixes nested request and adds topic migration (1d0ff95)
  • adds sections to migration script (f84ad0e)
  • adds profile to topic functionality, but hitting oom? (e80daa8)
  • adds configs and skeleton of profile migration (700ce9e)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • removes header locale detection (974ebff)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

Big CSS/React refactor thanks to @perpetualgrimace!

  • Merge pull request #552 from Datawheel/cms-refactor (79b066d)
  • Merge branch 'master' of https://github.com/Datawheel/canon into cms-refactor (3472ab8)
  • adds Card wrapper component (19d82de)
  • distributes/refactors shame.css (2d8a587)
  • refactors & tweaks layout css; adds SidebarTree wrapper component (604c362)
  • tweaks button theming (0faf1d4)
  • comments out new story auto switching since it seems unreliable (5094259)
  • shows default cards for meta entities in Section (0ce0688)
  • adds Button component and replaces all CMS buttons with it; adjusts typography; renames Flag to LocaleName (4bc5665)
  • checks for empty config in viz cards in JS mode (e21501a)
  • refactors story topic editor sections into new Section component (e0b30e4)
  • refactors story builder sections into new Section component (747e85a)
  • gives TextCard dialogs useful titles (f4ccb36)
  • trims unused multiselect css (e3d81e5)
  • creates Status component, consolidates more styles (e94961e)
  • deletes unused styles, organizes old styles in preparation for integration, imports mixins.css to all component .css files (640d303)
  • fixes tree icon disappearing on hover (8a0b425)
  • automatically switches to newly created profile (8114e46)
  • refactors topic editor sections into Section component (305c6af)
  • fixes FormatterEditor layout (a6645fa)
  • consolidates VisualizationCard and adds title (WIP) (44da47a)
  • removes commented theme switch (724a840)
  • imporlts mixin file in components (c124974)
  • refactors profile builder sections into new Section component (dbfc483)
  • moves theming back into components (5bb2b53)
  • fixes materializer cards not showing variables in two columns (3772942)
  • begins css refactor (splits out cms.css into partials) (6cb221f)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

This release brings in full tesseract support to the cms!

Additionally, canon-cms no longer improperly borrows CANON_LOGICLAYER_CUBE as a way to designate where data lives. Users should now use CANON_CMS_CUBES to designate a mondrian or tesseract endpoint.

🔥BREAKING 🔥
CANON_CMS_CUBES originally expected a path like path.com/cubes because it was used for fetching cube metadata. From now on, CANON_CMS_CUBES should be set only to the base path for mondrian or tesseract, (path.com), because the /cubes suffix is now added internally to fetch metadata in the appropriate place.

  • fixes bug in ID ordering for tesseract (44b13e2)
  • updates tesseract-client (73282d3)
  • adds different paths for different clients (36bfb2c)
  • updates package lock (ce27083)
  • adds framework in cmsroute for tesseract/mondrian (7d2b667)
  • adds tesseract to package lock (d61e6ae)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • adds envrc to npmignore (44ee6eb)
canon - @datawheel/[email protected]

Published by davelandry over 5 years ago

  • adds envrc to npmignore (c809af3)