Thematic is a library and web application to aid designers in creating color palettes that unify application colors based on a desired look and feel (e.g., corporate branding) while also providing perceptually balanced color palettes and ramps for data visualization within the application. The primary goal is to provide several bindings to common application development and visualization frameworks, so theming across platforms and contexts is simple and consistent across platforms such as Power BI, Office, and web frameworks (React, Fabric, D3, Vega).
Перейти к файлу
Nathan Evans 258ab5e122 Merge pull request #30 from microsoft/deps-update-nov10
Deps update nov10
2021-11-10 14:04:53 -08:00
.github/workflows fix github pages config 2021-05-08 10:00:31 -07:00
.husky upgrade libs, use husky 6 2021-05-08 15:17:17 -07:00
.vscode build: get lint running 2020-10-20 17:31:47 -07:00
.yarn Changeset for dep moves 2021-11-10 12:53:43 -08:00
packages Move essex scripts to dev deps 2021-11-10 12:17:06 -08:00
.editorconfig Initial commit 2020-07-24 17:26:16 -07:00
.eslintignore Initial commit 2020-07-24 17:26:16 -07:00
.eslintrc Initial commit 2020-07-24 17:26:16 -07:00
.gitattributes Initial commit 2020-07-24 17:26:16 -07:00
.gitignore docs: remove lerna references 2020-10-20 19:04:14 -07:00
.npmignore docs: remove lerna references 2020-10-20 19:04:14 -07:00
.pnp.js use ts-ignore on color-blind import 2021-07-28 13:54:52 -07:00
.prettierignore build: initial yarn commit 2020-10-20 16:47:15 -07:00
.vsts-ci.yml Add starter compliance CI yml 2021-11-10 12:26:09 -08:00
.yarnrc.yml yarn updates 2021-05-07 10:27:48 -07:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-07-20 11:55:18 -07:00
LICENSE Initial LICENSE commit 2020-07-20 11:55:19 -07:00
README.md fix github pages config 2021-05-08 10:00:31 -07:00
SECURITY.md Fix READMEs for alex sensitivity 2020-07-24 18:36:47 -07:00
babel.config.js upgrade react (17), remove synthetic imports 2021-05-11 12:17:44 -07:00
jest.config.js build: fix up jest with babel 2021-05-06 15:17:08 -07:00
package.json Use strict linting 2021-07-28 12:24:43 -07:00
tsconfig.json upgrade react (17), remove synthetic imports 2021-05-11 12:17:44 -07:00
yarn.lock use ts-ignore on color-blind import 2021-07-28 13:54:52 -07:00

README.md

Thematic

This repository holds all of the packages for creating shareable, perceptually-balanced and tastefully complementary (hopefully!) application and data viz themes. There are adapter libraries and tools to apply themes across several environments, which will be detailed below. We briefly describe the intentions and usage of the library in a paper on visualizing workgroup collaboration.

This repository is structured as a yarn monorepo. It contains separate packages for all of the theme generation, management, and applications. To use thematic in your app, you should only need to install the relevant packages for your use case(s).

The webapp package is a guide for everything Thematic. In particular, it comprises:

  • A running application for configuring theme parameters
  • An example app using thematic itself, so you can see what controls and charts look like
  • A variety of code examples to explore showing how to use thematic in practice

Organization

Our thematic packages are published under the @thematic scope.

These are the core Thematic libraries, see individual README.md files for greater detail:

  • @thematic/color - this contains color conversion and scale generation logic. If you need functions to convert between color spaces, this is the place. This also has the color scheme compute logic that dictates how all of the color scales are generated from a few selected input parameters.
  • @thematic/core - this is the main package for working with Themes. You can load them from a Theme JSON specification, then use the attributes directly in your app to apply the generated colors in a consistent way. We've used SVG notation for all of our mark properties (e.g., 'fill').
  • @thematic/d3 - this package has helpers to apply the themes to viz created with d3. We provide a variety of SVG mark primitives that operate on a d3 Selection, so you can apply the theme elements using selection.call(fn, [params]) as needed.
  • @thematic/fluent - helpers for applying Thematic to the Fluent UI library
  • @thematic/react - helpers to bootstrap theming into React-based apps, particularly a provider and context hook (useThematic) for grabbing the theme anywhere it is needed.
  • @thematic/vega - this has a helper that applies our theme spec as default configuration for Vega charts so they automatically adopt the theme.
  • @thematic/webapp - this is the theme editor webapp that you can run or access at https://microsoft.github.io/thematic.

Getting Started

If you want to run locally and work on the app or any theme components, you can run the whole thing from the root folder. The web app will run using yarn start:webapp as with our typical development structure, and changes to any of the other packages will be reflected live. See the Available Scripts section below.

Publishing

Commits to main will automatically deploy to the hosted website. Pull requests should use yarn version check --interactive to create semantic versioning documents describing the impact of the PR. When a release is ready, runyarn release_all to publish packages to npm.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode. An available port will be selected automatically, such as 8080. Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

yarn test

Launches the test runner using Jest.

yarn build:all

Builds packages for production to their respective dist and lib folders. Note that the webapp uses a bundle command more appropriate to creating an optimized web bundle. CI systems will want to invoke both of these to produce complete

yarn clean:all

Cleans out the node_modules and built lib directories for every package.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.