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 almost 6 years ago

  • adds transpiling for stories (ff1b890)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • fixes ie bug by transpiling all client js (3d2e170)
  • adds support for multiselect to topic endpoint (95d0bf1)
  • adds didUpdate callback for percentagebar to re-render on config change (daafba5)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • refactors isdev to include CANON_CMS_ENABLE (591bc5f)
  • makes selector editor somewhat less opaque; closes #367 (21efa92)
  • reduces horizontal dialog padding (593378b)
  • fixes additional button-appended input group (dc4ed67)
  • fixes button-appended input groups; closes #356 (facc778)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • removes incorrect Footnote reference text (628c363)
  • allows Topic to be used by story content (28021c0)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • refactors subtitles, fixes date bug (5216616)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • fixes pathing issue with Selector (fb9a41e)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • fixes front-end profile api to include footnotes (7b1ad2a)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • adds "multi" selector component (3e6f5a2)
  • generalizes Selector component and adds HTML labels (354c9c8)
  • adds Tab logic for viz config selectors (92f3c19)
  • adds Stats and AnchorLink titles to Column and Tabs topics (bd61a99)
  • adds tree icons for Card and Tabs topics (8837a13)
  • renders encoded HTML in Stats (a230dcf)
  • adds new Card topic type (50913b3)
  • fixes Loading color in CMS sample app (aff3236)
  • fixes save image icon in topic options (babc7d2)
  • fixes topictype dir on windows (e958184)
  • adds subtitles to stories (8855db2)
  • kicks user to root if not on development node_env (1306749)
  • removes test path for auth (e2d0b3f)
  • refactors auth routing to express middleware (33822d2)
  • actually uses return to boot out properly (2bd456c)
  • adds dev-only outs to c/u/d operations of cms (e4d9e6f)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • adds description toggline to Tabs topic (1c75cf9)
  • corrects canon-core README (94df7aa)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • makes small text change in example (9e63fe2)
  • adds extra configs for #386 (4f7c784)
  • addresses PR comments, adds isNaN checks and removes comments (9a97103)
  • adds ability to override show/hide text (d5cce26)
  • adds three-arg numberFormat for complex formatting (fda5050)
  • adds temporary testing page and sample formatter (851c4e7)
  • changes render behavior for perc bar for a cdc chart (c350f88)
  • adds linting exception to formatters that user other formatters (d94b3f7)
  • moves formatters from master file to individual files (8fd6661)
  • Merge pull request #388 from Datawheel/issue-238 (08bb3cd)
  • pulls from master (371c9b1)
  • adds cancel button functionality to selectorcard (979d08f)
  • adds cancel functionality to textcards (c33927d)
  • adds cancel logic to visualizations (3638669)
  • adds cancel logic to generatorcards (d816165)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

v0.17.0 of canon-core revolves around the upgrading of multiple major dependencies, most notably Webpack v4 and React v16 (which then enables the latest Blueprintjs modules). Please read the following notes, as there are many breaking changes.

Migration Guide

📘 Upgrading Blueprint

There are multiple steps to upgrade Blueprint modules to their latest versions (v3 as of this writing).

  1. Use npm i to upgrade all blueprint packages used in your project to their @latest versions
  2. Run the v1 to v2 upgrade script: npx upgrade-blueprint-2.0.0-rename --path=./app
  3. Run the v2 to v3 upgrade script: npx upgrade-blueprint-3.0.0-rename --path=./app
  4. Rename all pt- class prefixes to bp3- (that number will now increment with new versions of blueprint)

🍻 Toasts

The Toaster component in older versions of Blueprint used a React API that has now been deprecated (it used an anti-pattern to add the pop-up to the page <body> outside of React scope). canon-core now passed a toaster component through context that you should use instead. Here is an example pseudo-usage:

import React, {Component} from "react";
import PropTypes from "prop-types";

class MyComponent extends Component {

  showToast() {

    const Toast = this.context.toast.current;

    Toast.show({
      icon: "heart", 
      message: "Wow, thanks for reading release notes!"
    });

  }

  render() {
    return <div onClick={this.showToast.bind(this)}>Click Me!</div>;
  }

}

MyComponent.contextTypes = {
  toast: PropTypes.object
};

export default MyComponent;

If you're curious about how they work from scratch, check out the <CanonProvider /> to see how it is currently being passed down using context.

⭐ Blueprint Icons

The latest version of Blueprint has switched from using a custom font-family to using raw SVG for all icons. The old font-family is still supported, but it is suggested to start porting icons over to the new SVG standard. Read more about it here.

㊗️ react-i18next translations

The translate() function that we need to wrap all localized components with in order to get translations has been deprecated. It still works, but it is suggested to migrate to the new withNamespaces() drop-in replacement.

render Parentheses

It's sometimes nice to have a component render return an element wrapped in parentheses like this:

return (
  <div>Hello</div>
);

However, in React 16, this results in the following console error:

Warning: Did not expect server HTML to contain a <div> in <div>.

The solution is to remove the parentheses:

return <div>Hello</div>;

👪 this.props.children

In the old React, when rendering children, it was possible to do the following:

return <div id="wrapper">
  <a href="/">Go Home</a>
  { this.props.children }
  <footer>Copyright Dave</footer>
</div>;

However, in React v16, this now throughs a key error. The solution is to wrap this.props.children in a containing element:

return <div id="wrapper">
  <a href="/">Go Home</a>
  <div>{ this.props.children }</div>
  <footer>Copyright Dave</footer>
</div>;

Dependency Update List

  • @blueprintjs/core 1.35.5 to ^3.10.0
  • axios ^0.17.1 to ^0.18.0
  • babel-eslint ^8.2.3 to ^10.0.1
  • babel-plugin-direct-import removed
  • babel-plugin-transform-imports removed
  • d3plus-react ^0.5.1 to ^0.5.2
  • d3plus-text ^0.9.33 to ^0.9.34
  • d3plus-viz ^0.12.4 to ^0.12.6
  • eslint ^4.13.1 to ^5.11.1
  • eslint-plugin-react ^7.5.1 to ^7.12.2
  • extract-text-webpack-plugin replaced with mini-css-extract-plugin
  • hard-source-webpack-plugin ^0.6.4 to ^0.13.1
  • i18next-express-middleware ^1.0.7 to ^1.7.0
  • i18next-node-fs-backend ^1.0.0 to ^2.1.1
  • postcss-cssnext replaced with postcss-preset-env
  • react ^15.6.2 to ^16.7.0
  • react-addons-css-transition-group removed
  • react-dom ^15.6.2 to ^16.7.0
  • react-i18next ^6.1.0 to ^9.0.1
  • react-redux ^5.0.6 to ^6.0.0
  • redux ^3.7.2 to ^4.0.1
  • webpack ^3.10.0 to ^4.28.3
  • webpack-bundle-analyzer ^2.9.1 to ^3.0.3
  • webpack-cli added
  • webpack-dev-middleware ^2.0.1 to ^3.4.0
  • webpack-hot-middleware ^2.21.0 to ^2.24.3
  • yn ^2.0.0 to ^3.0.0

Commit Log

  • migrate from postcss-cssnext to postcss-preset-env (5279ad2)
  • upgrades to webpack v4 (dea3a81)
  • removes CANON_ATTRS variable (8fca57c)
  • updates yn to v3 (f35217a)
  • updates linting packages (bed9e5c)
  • updates hard-source-webpack-plugin to v0.13 (08083b4)
  • updates axios to v0.18 (eb557cf)
  • fixes Sequelize operator deprecation warning (7fbc0dd)
  • updates to latest react and blueprint dependencies (ccbaaf2)
  • fixes example app localization files (bd37074)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • adds delete alert to stories and fixes bug in textcards (bea4b8d)
  • adds delete alerts to all cards (5d45eb0)
  • adds prunesearch function to remove search entires after profile deletion (5d48a3f)
  • fixes dimensions in profilebuilder, closes #256 (f5615ad)
  • adds datepicker to stories for issue #361 (5c84584)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • fixes tab regex (bc929ab)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • fixes bug with missing await (d98c7e0)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • overhauls sorting to include 'flatten' capability for when ordering breaks (4ba4ffd)
  • implements Tabs topic type (b3d61f3)
  • adds selectors to Column topic type (0ec58e0)
  • hooks up sample profile page (8967830)
  • updates package-lock.json (338cf2e)
  • fixes bug where sources would report true but non are actually available (446d24c)
  • wraps formatters in try/catch to prevent crashes for issue #364 (a764f02)
  • defaults to simple mode for gen/viz closes #353 (6e23a63)
  • adds custom defaults for multiselects, closes #366 (6f2dd41)
  • adds ability for multiselects to have no defaults (0b3a44c)
  • fixes storytopics not loading, closes #362 (c1830b1)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • updates Data USA testing server (f71b9d8)
  • updates deep dependencies (363559f)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • implements mondrian-rest-client MultiClient (5196b13)
  • fixes bug on geomaps' chart criteria fixes bug on permalink parsing and member loading adds postUpdateHook on SidebarCRUDManager fixes minor format issues (6899c8d)
  • adds titles to footnotes (f2d1b5c)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • fixes minor bug when measure doesn't have annotation table_id (4b1a11b)
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • removes automatic year drilldown if specifying a drilldown in that dimension (a53e867)
  • fixes incorrect level name matching (4ef97e6)
  • adds CANON_LOGICLAYER_LOGGING env var
canon - @datawheel/[email protected]

Published by davelandry almost 6 years ago

  • implements a way to keep groups and filters after changing dataset (9136e78)
  • updates title syntax updates dependencies (a0f3d41)