Skip to content

Commit 0f96203

Browse files
committed
"sync"
1 parent 0d8e4d3 commit 0f96203

35 files changed

+957
-56
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
3+
MIT License
4+
5+
Copyright (c) 2022 Looker Data Sciences, Inc.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
*/
26+
module.exports = api => {
27+
api.cache.forever()
28+
return {
29+
presets: [
30+
require('@looker/babel-preset-styled-components'),
31+
require('@looker/babel-preset-typescript'),
32+
],
33+
}
34+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OWNERS
Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,73 @@
1-
# Change Log
1+
# [2.1.0](https://github.com/looker-open-source/components/compare/22.16.0...2.1.0) (2022-10-12)
22

3-
All notable changes to this project will be documented in this file.
4-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
53

6-
## [1.0.4](https://github.com/looker-open-source/components/compare/@looker/[email protected]...@looker/[email protected]) (2022-05-23)
4+
### Features
75

8-
**Note:** Version bump only for package @looker/visualization-playground
6+
* add show_totals and show_row_totals config transformation b/248616608 ([8fda5e1](https://github.com/looker-open-source/components/commit/8fda5e15d6622b9928399f8e13393b3a8383973c))
97

108

119

10+
# [2.0.0](https://github.com/looker-open-source/components/compare/22.16.0...2.0.0) (2022-09-22)
11+
12+
### Features
13+
* Toggle config.show_totals for table visualizations
14+
* Render updated table visualization
15+
16+
# [1.4.0](https://github.com/looker-open-source/components/compare/22.10.3...1.4.0) (2022-09-07)
17+
18+
### Features
19+
20+
* Add ability to toggle config.truncate_header for table visualizations
21+
22+
### Reverts
23+
24+
* Revert "Move no-restricted-imports to eslint plugin" ([3c5d40b](https://github.com/looker-open-source/components/commit/3c5d40b14453034528a39a6d52261c64efd43082))
25+
26+
27+
28+
# [1.3.0](https://github.com/looker-open-source/components/compare/22.10.3...1.3.0) (2022-07-29)
29+
30+
Adds theme provider within package
31+
32+
### Reverts
33+
34+
* Revert "Move no-restricted-imports to eslint plugin" ([3c5d40b](https://github.com/looker-open-source/components/commit/3c5d40b14453034528a39a6d52261c64efd43082))
1235

1336

14-
## [1.0.3](https://github.com/looker-open-source/components/compare/@looker/[email protected]...@looker/[email protected]) (2022-05-16)
37+
38+
# [1.2.0](https://github.com/looker-open-source/components/compare/22.10.3...1.2.0) (2022-07-29)
39+
40+
Update package json `main` setting
41+
42+
## [1.1.0](https://github.com/looker-open-source/components/compare/22.10.3...1.1.0) (2022-07-28)
43+
44+
Update looker-components peer dependency.
45+
46+
47+
## [1.0.4](https://github.com/looker-open-source/components/compare/@looker/[email protected]...@looker/[email protected]) (2022-05-23)
1548

1649
**Note:** Version bump only for package @looker/visualization-playground
1750

1851

1952

2053

2154

22-
## [1.0.2](https://github.com/looker-open-source/components/compare/@looker/[email protected].1...@looker/[email protected].2) (2022-05-11)
55+
## [1.0.3](https://github.com/looker-open-source/components/compare/@looker/[email protected].2...@looker/[email protected].3) (2022-05-16)
2356

2457
**Note:** Version bump only for package @looker/visualization-playground
2558

2659

2760

2861

2962

30-
## 1.0.1 (2022-04-29)
63+
## [1.0.2](https://github.com/looker-open-source/components/compare/@looker/[email protected]...@looker/[email protected]) (2022-05-11)
3164

3265
**Note:** Version bump only for package @looker/visualization-playground
3366

3467

3568

3669

3770

38-
# Change Log
71+
## 1.0.1 (2022-04-29)
72+
73+
**Note:** Version bump only for package @looker/visualization-playground
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
3+
MIT License
4+
5+
Copyright (c) 2022 Looker Data Sciences, Inc.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
*/
26+
const { config } = require('@looker/jest-config')
27+
28+
module.exports = config

packages/visualization-playground/package.json

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,59 @@
11
{
22
"name": "@looker/visualization-playground",
3+
"license": "MIT",
34
"main": "src/index.ts",
4-
"version": "1.0.4",
5+
"version": "2.1.0",
6+
"description": "A demo and development environment for building Looker Visualization Components",
7+
"sideEffects": false,
58
"publishConfig": {
6-
"access": "public"
9+
"access": "public",
10+
"registry": "https://registry.npmjs.org"
11+
},
12+
"repository": {
13+
"url": "looker-open-source/components",
14+
"directory": "packages/visualization-playground"
15+
},
16+
"files": [
17+
"src",
18+
"lib"
19+
],
20+
"scripts": {
21+
"test": "lk test",
22+
"coverage": "lk coverage",
23+
"prepublishOnly": "lk prepublishOnly"
724
},
8-
"license": "MIT",
9-
"sideEffects": false,
1025
"dependencies": {
11-
"@looker/components": "^3.0.8",
12-
"@looker/components-data": "^0.1.7",
13-
"@looker/design-tokens": "^2.7.21",
26+
"@looker/components": "*",
27+
"@looker/components-data": "^1.0.0",
28+
"@looker/filter-components": "*",
29+
"@looker/visualizations": "^1.1.0",
30+
"@looker/visualizations-adapters": "^1.0.0",
1431
"@looker/extension-sdk-react": "^22.4.2",
15-
"@looker/filter-components": "^0.10.22",
1632
"@looker/sdk": "^22.4.2",
1733
"@looker/sdk-rtl": "^21.3.3",
18-
"@looker/visualizations": "^0.2.15",
19-
"@looker/visualizations-adapters": "^0.1.16",
20-
"@styled-icons/material": "10.28.0",
34+
"@styled-icons/material": "10.34.0",
35+
"@visx/group": "^2.10.0",
36+
"@visx/point": "^2.6.0",
37+
"@visx/scale": "^2.2.2",
38+
"@visx/shape": "2.10.0",
2139
"lodash": "4.17.21",
2240
"prism-react-renderer": "1.3.1",
2341
"react": "16.14.0",
2442
"react-dom": "16.14.0",
2543
"styled-components": "5.3.1",
26-
"styled-system": "^5.1.5"
44+
"styled-system": "*"
2745
},
2846
"devDependencies": {
29-
"@looker/components-test-utils": "^1.5.26",
30-
"@looker/eslint-config-oss": "^1.7.21",
47+
"@looker/babel-preset-styled-components": "*",
48+
"@looker/babel-preset-typescript": "*",
49+
"@looker/components-scripts": "*",
50+
"@looker/components-test-utils": "*",
51+
"@looker/eslint-config-oss": "*",
52+
"@looker/jest-config": "*",
3153
"@storybook/testing-react": "0.0.22",
32-
"@testing-library/react": "*",
33-
"@types/styled-system": "^5.1.5"
54+
"@testing-library/react": "*"
3455
},
3556
"peerDependencies": {
36-
"@looker/components": "1.4 - 2",
37-
"@looker/components-data": "0 - 1",
3857
"react": "16.11.0 - 18",
3958
"react-dom": "16.11.0 - 18",
4059
"styled-components": "^5.3.1"
@@ -66,7 +85,8 @@
6685
}
6786
]
6887
}
69-
]
88+
],
89+
"i18next/no-literal-string": "off"
7090
}
7191
},
7292
"stylelint": {

packages/visualization-playground/src/Checkbox/Checkbox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ interface CheckboxProps {
4242
export const Checkbox: FC<CheckboxProps> = ({ onChange, label, checked }) => {
4343
const [isChecked, setIsChecked] = useState(Boolean(checked))
4444
useEffect(() => {
45-
onChange?.(isChecked)
46-
}, [isChecked, onChange])
45+
if (checked !== isChecked) {
46+
onChange?.(isChecked)
47+
}
48+
}, [isChecked, onChange, checked])
4749
return (
4850
<FieldCheckbox
4951
label={label}

packages/visualization-playground/src/ConfigEditor/ConfigEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626
import type { FC, Dispatch, SetStateAction } from 'react'
2727
import React from 'react'
28+
import { DEFAULT_EMPTY_FIELDS } from '@looker/visualizations-adapters'
2829
import type { CAll } from '@looker/visualizations-adapters'
2930
import type { QueryProps } from '@looker/visualizations'
3031
import {
@@ -53,7 +54,7 @@ export const ConfigEditor: FC<ConfigEditorProps> = ({
5354
const { queryId } = useQueryId(query || dashboardQueryId)
5455
const { visConfig } = useVisConfig(queryId, configOverrides)
5556

56-
const { fields = { measures: [], dimensions: [] } } = useQueryData(queryId)
57+
const { fields = DEFAULT_EMPTY_FIELDS } = useQueryData(queryId)
5758

5859
return (
5960
<StyledCard>

packages/visualization-playground/src/EmbedEditor/EmbedEditor.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
*/
2626
import type { FC, FormEvent, SetStateAction, Dispatch } from 'react'
2727
import React from 'react'
28-
import { FieldText, FieldSelect, Heading, Fieldset } from '@looker/components'
28+
import {
29+
FieldText,
30+
FieldSelect,
31+
Heading,
32+
Fieldset,
33+
Grid,
34+
} from '@looker/components'
2935
import { FieldInfo } from '../FieldInfo'
3036
import type { CAll, SupportedChartTypes } from '@looker/visualizations-adapters'
3137
import { SUPPORTED_CHART_TYPES } from '@looker/visualizations-adapters'
@@ -39,7 +45,10 @@ import { RenderNullValues } from '../RenderNullValues'
3945
import { Tooltips } from '../Tooltips'
4046
import { Positioning } from '../Positioning'
4147
import { TruncateText } from '../TruncateText'
48+
import { TruncateHeader } from '../TruncateHeader'
4249
import { StyledCard } from '../StyledCard'
50+
import { ShowTotals } from '../ShowTotals'
51+
import { ShowRowTotals } from '../ShowRowTotals'
4352

4453
interface EmbedEditorProps {
4554
width?: string
@@ -90,6 +99,7 @@ export const EmbedEditor: FC<EmbedEditorProps> = ({
9099
value={visConfig.type}
91100
options={[
92101
...Object.values(SUPPORTED_CHART_TYPES).map(t => ({ value: t })),
102+
{ value: 'radar', label: 'Custom Vis: Radar' },
93103
]}
94104
/>
95105
<Fieldset inline>
@@ -120,12 +130,18 @@ export const EmbedEditor: FC<EmbedEditorProps> = ({
120130
</Fieldset>
121131
<Legend config={visConfig} onConfigChange={onConfigChange} />
122132
<Fieldset inline>
123-
<Tooltips config={visConfig} onConfigChange={onConfigChange} />
124-
<RenderNullValues config={visConfig} onConfigChange={onConfigChange} />
125-
</Fieldset>
126-
<Fieldset inline>
127-
<Positioning config={visConfig} onConfigChange={onConfigChange} />
128-
<TruncateText config={visConfig} onConfigChange={onConfigChange} />
133+
<Grid>
134+
<Tooltips config={visConfig} onConfigChange={onConfigChange} />
135+
<RenderNullValues
136+
config={visConfig}
137+
onConfigChange={onConfigChange}
138+
/>
139+
<Positioning config={visConfig} onConfigChange={onConfigChange} />
140+
<TruncateText config={visConfig} onConfigChange={onConfigChange} />
141+
<TruncateHeader config={visConfig} onConfigChange={onConfigChange} />
142+
<ShowTotals config={visConfig} onConfigChange={onConfigChange} />
143+
<ShowRowTotals config={visConfig} onConfigChange={onConfigChange} />
144+
</Grid>
129145
</Fieldset>
130146
</StyledCard>
131147
)

0 commit comments

Comments
 (0)