Skip to content

Commit

Permalink
Merge branch 'master' into feat-legend-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson authored Dec 18, 2019
2 parents c13d0a8 + fb21492 commit 941b88a
Show file tree
Hide file tree
Showing 34 changed files with 394 additions and 70 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,55 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.24.0](https://github.com/IBM/carbon-charts/compare/v0.23.0...v0.24.0) (2019-12-17)


### Features

* **core, react, angular, vue:** add WAI-ARIA tags to elements ([1216ed6](https://github.com/IBM/carbon-charts/commit/1216ed6))





# [0.23.0](https://github.com/IBM/carbon-charts/compare/v0.22.4...v0.23.0) (2019-12-17)


### Features

* **core:** add spacer components ([4e5ab5c](https://github.com/IBM/carbon-charts/commit/4e5ab5c))





## [0.22.4](https://github.com/IBM/carbon-charts/compare/v0.22.3...v0.22.4) (2019-12-16)

**Note:** Version bump only for package @carbon/charts-monorepo





## [0.22.3](https://github.com/IBM/carbon-charts/compare/v0.22.2...v0.22.3) (2019-12-16)


### Bug Fixes

* **core:** update tooltip value formatter ([2a978d8](https://github.com/IBM/carbon-charts/commit/2a978d8))





## [0.22.2](https://github.com/IBM/carbon-charts/compare/v0.22.1...v0.22.2) (2019-12-16)

**Note:** Version bump only for package @carbon/charts-monorepo





## [0.22.1](https://github.com/IBM/carbon-charts/compare/v0.22.0...v0.22.1) (2019-12-12)


Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @theiliad @natashadecoste
* @theiliad @natashadecoste @carbon-design-system/carbon-charts
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
- [React](./packages/react)
- [Vue](./packages/vue)

## CHANGELOG
Read the release change logs [here](./CHANGELOG.md)

## Component status
:white_check_mark: Stable :hourglass_flowing_sand: In progress

Expand Down Expand Up @@ -55,7 +58,7 @@ Get updates on Charts' development and chat with the core team and community. --

We use the **semantic-release** library to automatically version our releases within the guidelines of Semantic Versioning [Semantic Versioning guidelines](http://semver.org/).

See our [releases notes](https://github.com/carbon-design-system/carbon-charts/releases) for the changelog of each version of Charts.
See our [release change logs](https://github.com/carbon-design-system/carbon-charts/blob/master/CHANGELOG.md) for the changelog of each version of Charts.


## Core Team
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
]
}
},
"version": "0.22.1"
"version": "0.24.0"
}
40 changes: 40 additions & 0 deletions packages/angular/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,46 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.24.0](https://github.com/IBM/carbon-charts/compare/v0.23.0...v0.24.0) (2019-12-17)

**Note:** Version bump only for package @carbon/charts-angular





# [0.23.0](https://github.com/IBM/carbon-charts/compare/v0.22.4...v0.23.0) (2019-12-17)

**Note:** Version bump only for package @carbon/charts-angular





## [0.22.4](https://github.com/IBM/carbon-charts/compare/v0.22.3...v0.22.4) (2019-12-16)

**Note:** Version bump only for package @carbon/charts-angular





## [0.22.3](https://github.com/IBM/carbon-charts/compare/v0.22.2...v0.22.3) (2019-12-16)

**Note:** Version bump only for package @carbon/charts-angular





## [0.22.2](https://github.com/IBM/carbon-charts/compare/v0.22.1...v0.22.2) (2019-12-16)

**Note:** Version bump only for package @carbon/charts-angular





## [0.22.1](https://github.com/IBM/carbon-charts/compare/v0.22.0...v0.22.1) (2019-12-12)


Expand Down
4 changes: 2 additions & 2 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@carbon/charts-angular",
"version": "0.22.1",
"version": "0.24.0",
"description": "Carbon charting components for Angular",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -39,7 +39,7 @@
"scss"
],
"dependencies": {
"@carbon/charts": "^0.22.1"
"@carbon/charts": "^0.24.0"
},
"peerDependencies": {
"@angular/common": "^6.0.0 || ^7.0.0",
Expand Down
49 changes: 49 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,55 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.24.0](https://github.com/IBM/carbon-charts/compare/v0.23.0...v0.24.0) (2019-12-17)


### Features

* **core, react, angular, vue:** add WAI-ARIA tags to elements ([1216ed6](https://github.com/IBM/carbon-charts/commit/1216ed6))





# [0.23.0](https://github.com/IBM/carbon-charts/compare/v0.22.4...v0.23.0) (2019-12-17)


### Features

* **core:** add spacer components ([4e5ab5c](https://github.com/IBM/carbon-charts/commit/4e5ab5c))





## [0.22.4](https://github.com/IBM/carbon-charts/compare/v0.22.3...v0.22.4) (2019-12-16)

**Note:** Version bump only for package @carbon/charts





## [0.22.3](https://github.com/IBM/carbon-charts/compare/v0.22.2...v0.22.3) (2019-12-16)


### Bug Fixes

* **core:** update tooltip value formatter ([2a978d8](https://github.com/IBM/carbon-charts/commit/2a978d8))





## [0.22.2](https://github.com/IBM/carbon-charts/compare/v0.22.1...v0.22.2) (2019-12-16)

**Note:** Version bump only for package @carbon/charts





## [0.22.1](https://github.com/IBM/carbon-charts/compare/v0.22.0...v0.22.1) (2019-12-12)

**Note:** Version bump only for package @carbon/charts
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@carbon/charts",
"version": "0.22.1",
"version": "0.24.0",
"description": "Carbon charting components",
"main": "./bundle.js",
"module": "./index.js",
Expand Down
28 changes: 27 additions & 1 deletion packages/core/src/axis-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
Legend,
Title,
Tooltip,
TooltipBar
TooltipBar,
Spacer
} from "./components/index";
import { Tools } from "./tools";

Expand Down Expand Up @@ -83,6 +84,17 @@ export class AxisChart extends Chart {
}
}

const legendSpacerComponent = {
id: "spacer",
components: [
new Spacer(this.model, this.services)
],
growth: {
x: LayoutGrowth.PREFERRED,
y: LayoutGrowth.FIXED
}
};

const fullFrameComponent = {
id: "full-frame",
components: [
Expand All @@ -91,6 +103,7 @@ export class AxisChart extends Chart {
this.services,
[
...(isEnabled ? [ legendComponent ] : [ ]),
legendSpacerComponent,
graphFrameComponent
],
{
Expand All @@ -108,6 +121,19 @@ export class AxisChart extends Chart {
const topLevelLayoutComponents = [];
if (this.model.getOptions().title) {
topLevelLayoutComponents.push(titleComponent);

const titleSpacerComponent = {
id: "spacer",
components: [
new Spacer(this.model, this.services)
],
growth: {
x: LayoutGrowth.PREFERRED,
y: LayoutGrowth.FIXED
}
};

topLevelLayoutComponents.push(titleSpacerComponent);
}
topLevelLayoutComponents.push(fullFrameComponent);

Expand Down
28 changes: 27 additions & 1 deletion packages/core/src/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { Component,
Title,
Legend,
LayoutComponent,
Tooltip
Tooltip,
Spacer
} from "./components";
import { Tools } from "./tools";

Expand Down Expand Up @@ -171,6 +172,17 @@ export class Chart {
}
}

const legendSpacerComponent = {
id: "spacer",
components: [
new Spacer(this.model, this.services)
],
growth: {
x: LayoutGrowth.PREFERRED,
y: LayoutGrowth.FIXED
}
};

const fullFrameComponent = {
id: "full-frame",
components: [
Expand All @@ -179,6 +191,7 @@ export class Chart {
this.services,
[
...(isEnabled ? [ legendComponent ] : [ ]),
legendSpacerComponent,
graphFrameComponent
],
{
Expand All @@ -196,6 +209,19 @@ export class Chart {
const topLevelLayoutComponents = [];
if (this.model.getOptions().title) {
topLevelLayoutComponents.push(titleComponent);

const titleSpacerComponent = {
id: "spacer",
components: [
new Spacer(this.model, this.services)
],
growth: {
x: LayoutGrowth.PREFERRED,
y: LayoutGrowth.FIXED
}
};

topLevelLayoutComponents.push(titleSpacerComponent);
}
topLevelLayoutComponents.push(fullFrameComponent);

Expand Down
8 changes: 6 additions & 2 deletions packages/core/src/components/axes/axis.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Internal Imports
import { Component } from "../component";
import { AxisPositions, ScaleTypes, AxisTypes } from "../../interfaces";
import { AxisPositions, ScaleTypes, AxisTypes, Roles } from "../../interfaces";
import { Tools } from "../../tools";
import { ChartModel } from "../../model";
import { DOMUtils } from "../../services";
Expand Down Expand Up @@ -228,12 +228,16 @@ export class Axis extends Component {
const container = DOMUtils.appendOrSelect(svg, `g.axis.${axisPosition}`);
const axisRefExists = !container.select(`g.ticks`).empty();
let axisRef = DOMUtils.appendOrSelect(container, `g.ticks`);
if (!axisRefExists) {
axisRef.attr("role", `${Roles.GRAPHICS_OBJECT} ${Roles.GROUP}`);
}

// We draw the invisible axis because of the async nature of d3 transitions
// To be able to tell the final width & height of the axis when initiaing the transition
// The invisible axis is updated instantly and without a transition
const invisibleAxisRef = DOMUtils.appendOrSelect(container, `g.ticks.invisible`)
.style("opacity", "0");
.style("opacity", "0")
.attr("aria-hidden", true);

// Position and transition the axis
switch (axisPosition) {
Expand Down
Loading

0 comments on commit 941b88a

Please sign in to comment.