Skip to content

Commit

Permalink
refactor: rename encodeable to encodable (apache#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw authored and zhaoyongjie committed Nov 24, 2021
1 parent d8657cd commit bae528f
Show file tree
Hide file tree
Showing 55 changed files with 35 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

* add control panel support to chart plugin ([#203](https://github.com/apache-superset/superset-ui/issues/203)) ([920d389](https://github.com/apache-superset/superset-ui/commit/920d389))
* add functions for parsing formatters from encoding ([#205](https://github.com/apache-superset/superset-ui/issues/205)) ([8906aa0](https://github.com/apache-superset/superset-ui/commit/8906aa0))
* Add types and type guards for encodeable ([#201](https://github.com/apache-superset/superset-ui/issues/201)) ([6cff25f](https://github.com/apache-superset/superset-ui/commit/6cff25f))
* Add types and type guards for encodable ([#201](https://github.com/apache-superset/superset-ui/issues/201)) ([6cff25f](https://github.com/apache-superset/superset-ui/commit/6cff25f))


### BREAKING CHANGES
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## @superset-ui/encodable

[![Version](https://img.shields.io/npm/v/@superset-ui/encodable.svg?style=flat)](https://img.shields.io/npm/v/@superset-ui/encodable.svg?style=flat)
[![David (path)](https://img.shields.io/david/apache-superset/superset-ui.svg?path=packages%2Fsuperset-ui-encodable&style=flat-square)](https://david-dm.org/apache-superset/superset-ui?path=packages/superset-ui-encodable)

This package provides standardized API for encodable components and adopts the grammar from `vega-lite` grammar and copy their logic for determining smart defaults (e.g. choosing scale type based on data type, etc.)
In addition, it leverages sibling `superset-ui` packages to use the number and time formatters as well as color scales.

#### Example usage

```js
import { xxx } from '@superset-ui/encodable';
```

#### API

`fn(args)`

- Do something

### Development

`@data-ui/build-config` is used to manage the build configuration for this package including babel
builds, jest testing, eslint, and prettier.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@superset-ui/encodeable",
"name": "@superset-ui/encodable",
"version": "0.12.1",
"description": "Superset UI encodeable",
"description": "Superset UI encodable",
"sideEffects": false,
"main": "lib/index.js",
"module": "esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChannelDef } from '../types/ChannelDef';
import { isTypedFieldDef } from '../typeGuards/ChannelDef';
import { ChannelDef } from '../../types/ChannelDef';
import { isTypedFieldDef } from '../../typeGuards/ChannelDef';
import fallbackFormatter from './fallbackFormatter';
import createFormatterFromFieldTypeAndFormat from './createFormatterFromFieldTypeAndFormat';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getNumberFormatter } from '@superset-ui/number-format';
import { getTimeFormatter } from '@superset-ui/time-format';
import { Type } from '../types/VegaLite';
import { Formatter } from '../types/ChannelDef';
import { Type } from '../../types/VegaLite';
import { Formatter } from '../../types/ChannelDef';
import fallbackFormatter from './fallbackFormatter';

export default function createFormatterFromFieldTypeAndFormat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface CombinedScaleConfig<Output extends Value = Value>
/**
* name of the color scheme.
* vega-lite also support SchemeParams object
* but encodeable only accepts string at the moment
* but encodable only accepts string at the moment
*/
scheme?: string;
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createFormatterFromChannelDef from '../../src/parsers/createFormatterFromChannelDef';
import createFormatterFromChannelDef from '../../../src/parsers/format/createFormatterFromChannelDef';

describe('createFormatterFromChannelDef(type, format)', () => {
it('handles when format is defined', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createFormatterFromFieldTypeAndFormat from '../../src/parsers/createFormatterFromFieldTypeAndFormat';
import createFormatterFromFieldTypeAndFormat from '../../../src/parsers/format/createFormatterFromFieldTypeAndFormat';

describe('createFormatterFromFieldTypeAndFormat(type, format)', () => {
it('handles quantitative field type', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fallbackFormatter from '../../src/parsers/fallbackFormatter';
import fallbackFormatter from '../../../src/parsers/format/fallbackFormatter';

describe('fallbackFormatter(v: any)', () => {
it('handles primitive types', () => {
Expand Down

This file was deleted.

0 comments on commit bae528f

Please sign in to comment.