Skip to content

Commit

Permalink
feat(monorepo): Carbon v11 migration (#1345)
Browse files Browse the repository at this point in the history
* feat(monorepo): carbon v11 migration

BREAKING CHANGE: node-sass => sass, theming
  • Loading branch information
theiliad authored May 24, 2022
1 parent 3c20372 commit 97c6fcd
Show file tree
Hide file tree
Showing 5,687 changed files with 2,282 additions and 467,088 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
14
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</a>

## Design specifications

<a href="https://www.carbondesignsystem.com/data-visualization/getting-started" target="_blank">
<img src="./assets/dv_dark_theme.png" width=700 />
</a>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"lint": "lerna run lint",
"build": "yarn build-all",
"build-all": "bash scripts/build-packages-and-demos.sh",
"build-packages": "bash scripts/build-packages.sh",
"build-all-demos": "bash scripts/build-demos.sh",
"deploy": "bash scripts/deploy.sh"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/angular/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { configure } from '@storybook/angular';
import { setOptions } from '@storybook/addon-options';
import theme from './theme';

setOptions({
name: 'Carbon Charts - Angular',
showAddonPanel: true,
sortStoriesByKind: true,
panelPosition: 'bottom',
showDownPanel: true,
theme,
});

// load global styles
Expand Down
46 changes: 0 additions & 46 deletions packages/angular/.storybook/theme.js

This file was deleted.

8 changes: 4 additions & 4 deletions packages/angular/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"extends": "../tsconfig.json",
"exclude": [
"../src/test.ts",
"../src/**/*.spec.ts"
"../src/**/*.spec.ts",
"./node_modules",
"../../node_modules"
],
"include": [
"../src/**/*"
]
"include": ["../src/**/*"]
}
31 changes: 23 additions & 8 deletions packages/angular/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# `@carbon/charts-angular`
# Notice

### This version is in beta & relies on **Carbon v11**. If you're using Carbon v10, [see the legacy demo site](https://carbon-charts-0x.netlify.app)

## `@carbon/charts-angular`

> Carbon Charting Angular Wrappers
Expand All @@ -23,18 +27,29 @@ instead:
yarn add @carbon/charts @carbon/charts-angular d3
```

**Note:** you'd also need to install `carbon-components` if you're not using a bundled version of the library.
**Note:** you'd also need to install `carbon-components` if you're not using a
bundled version of the library.

## Step-by-step instructions
Read [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-getting-started--angular)

Read
[here](https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-getting-started--angular)

## Charting data & options
Although we will definitely introduce new models in the future as we start shipping new components such as maps, Data and options follow the same model in all charts, with minor exceptions and differences in specific components.

For instance in the case of a donut chart you're able to pass in an additional field called `center` in your options configuring the donut center.
Although we will definitely introduce new models in the future as we start
shipping new components such as maps, Data and options follow the same model in
all charts, with minor exceptions and differences in specific components.

For instance in the case of a donut chart you're able to pass in an additional
field called `center` in your options configuring the donut center.

For instructions on using the **tabular data format**, see [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format)
For instructions on using the **tabular data format**, see
[here](https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format)

There are also additional options available depending on the chart type being used, [see our demo examples here](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/core/demo/data).
There are also additional options available depending on the chart type being
used,
[see our demo examples here](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/core/demo/data).

Customizable options (specific to chart type) can be found [here](https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_charts_.html)
Customizable options (specific to chart type) can be found
[here](https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_charts_.html)
17 changes: 4 additions & 13 deletions packages/angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"./tsconfig.json",
"./tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"tsConfig": ["./tsconfig.json", "./tsconfig.spec.json"],
"exclude": ["./node_modules", "../../node_modules"]
}
}
}
Expand All @@ -53,12 +48,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**/*"
]
"tsConfig": ["e2e/tsconfig.e2e.json"],
"exclude": ["./node_modules", "../../node_modules"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Component, Input, HostBinding } from '@angular/core';
import settings from 'carbon-components/src/globals/js/settings';

const { prefix } = settings;
import { carbonPrefix } from '../configs';

@Component({
selector: 'ibm-diagram-card-node-column',
Expand All @@ -16,9 +14,9 @@ export class CardNodeColumnComponent {

@HostBinding('class') get class() {
const farsideClassName = this.farsideColumn
? `${prefix}--cc--card-node__column--farside`
? `${carbonPrefix}--cc--card-node__column--farside`
: '';

return `${prefix}--cc--card-node__column ${farsideClassName}`;
return `${carbonPrefix}--cc--card-node__column ${farsideClassName}`;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Component } from "@angular/core";
import settings from "carbon-components/src/globals/js/settings";

const { prefix } = settings;
import { carbonPrefix } from '../configs';

@Component({
selector: "ibm-diagram-card-node-label",
Expand All @@ -13,5 +11,5 @@ const { prefix } = settings;
})

export class CardNodeLabelComponent {
namespace = `${prefix}--cc--card-node__label`;
namespace = `${carbonPrefix}--cc--card-node__label`;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Component } from "@angular/core";
import settings from "carbon-components/src/globals/js/settings";

const { prefix } = settings;
import { carbonPrefix } from '../configs';

@Component({
selector: "ibm-diagram-card-node-subtitle",
Expand All @@ -13,5 +11,5 @@ const { prefix } = settings;
})

export class CardNodeSubtitleComponent {
namespace = `${prefix}--cc--card-node__subtitle`;
namespace = `${carbonPrefix}--cc--card-node__subtitle`;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Component } from "@angular/core";
import settings from "carbon-components/src/globals/js/settings";

const { prefix } = settings;
import { carbonPrefix } from '../configs';

@Component({
selector: "ibm-diagram-card-node-title",
Expand All @@ -13,5 +11,5 @@ const { prefix } = settings;
})

export class CardNodeTitleComponent {
namespace = `${prefix}--cc--card-node__title`;
namespace = `${carbonPrefix}--cc--card-node__title`;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import settings from 'carbon-components/src/globals/js/settings';

const { prefix } = settings;
import { carbonPrefix } from '../configs';

@Component({
selector: 'ibm-diagram-card-node',
Expand Down Expand Up @@ -88,7 +86,7 @@ export class CardNodeComponent implements OnInit {
@Output() mouseLeave: EventEmitter<any> = new EventEmitter<any>();
@Output() mouseMove: EventEmitter<any> = new EventEmitter<any>();

namespace = `${prefix}--cc--card-node`;
namespace = `${carbonPrefix}--cc--card-node`;

component = 'div';

Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/diagrams/configs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const carbonPrefix = 'cds';
6 changes: 3 additions & 3 deletions packages/angular/src/diagrams/edge/edge.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, Input } from "@angular/core";
import settings from "carbon-components/src/globals/js/settings";
import { buildStraightPathString } from "@carbon/charts/components/diagrams/buildPaths";

const { prefix } = settings;
import { carbonPrefix } from '../configs';

interface Coordinates {
x: number;
y: number;
Expand Down Expand Up @@ -40,6 +40,6 @@ export class EdgeComponent {
@Input() path: string;

pathClasses;
namespace = `${prefix}--cc--edge`;
namespace = `${carbonPrefix}--cc--edge`;
straight = buildStraightPathString;
}
5 changes: 2 additions & 3 deletions packages/angular/src/diagrams/marker/marker.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, Input, OnInit } from "@angular/core";
import settings from "carbon-components/src/globals/js/settings";
import {
arrowLeft,
arrowRight,
Expand All @@ -9,7 +8,7 @@ import {
tee,
} from "@carbon/charts/components/diagrams/markerDefinitions";

const { prefix } = settings;
import { carbonPrefix } from '../configs';

const template = `
<svg:marker
Expand Down Expand Up @@ -40,7 +39,7 @@ export class MarkerComponent {
@Input() refY: string | number;
@Input() position: "start" | "end" = "end";

namespace = `${prefix}--cc--marker`;
namespace = `${carbonPrefix}--cc--marker`;

setAttributes = ({d, id, height, width}) => {
const xPos = (this.position === "end") ? (width / 2) + 0.5 : 0.5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import {
TemplateRef,
OnInit,
} from '@angular/core';
import settings from 'carbon-components/src/globals/js/settings';

const { prefix } = settings;
import { carbonPrefix } from '../configs';

@Component({
selector: 'ibm-diagram-shape-node',
Expand Down Expand Up @@ -121,7 +120,7 @@ export class ShapeNodeComponent implements OnInit {
@Output() mouseLeave: EventEmitter<any> = new EventEmitter<any>();
@Output() mouseMove: EventEmitter<any> = new EventEmitter<any>();

namespace = `${prefix}--cc--shape-node`;
namespace = `${carbonPrefix}--cc--shape-node`;
component = 'div';

ngOnInit() {
Expand Down
12 changes: 8 additions & 4 deletions packages/angular/stories/all.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ import { storybookDemoGroups } from '@carbon/charts/demo/data';

const getTemplate = (demo) => `
<div class="container theme--white">
<div class="v10-banner">
This version is in beta & relies on <b>Carbon v11</b>. If you're using Carbon v10, <a href="https://carbon-charts-0x.netlify.app" target="_blank" rel="noreferrer">see the legacy demo site</a>
</div>
<h3>
<b>Component:</b>
<span class="bx--tag bx--tag--green component-name">${demo.chartType.angular}</span>
<span class="cds--tag cds--tag--green component-name">${demo.chartType.angular}</span>
</h3>
<p class="props"><b>Props:</b> data, <a href="https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_charts_.html" target="_blank">options</a></p>
<div class="marginTop-30">
<div class="marginTop-30" id="chart-demo">
<${demo.chartType.angular}
class="n-chart"
[data]="data"
Expand All @@ -28,8 +32,8 @@ const getTemplate = (demo) => `
<div class="marginTop-30" *ngFor="let codeFile of codeFiles;">
<h5>{{codeFile}}</h5>
<div class="bx--snippet bx--snippet--multi bx--snippet--expand marginTop-15" data-code-snippet>
<div class="bx--snippet-container" aria-label="Code Snippet Text">
<div class="cds--snippet cds--snippet--multi cds--snippet--expand marginTop-15" data-code-snippet>
<div class="cds--snippet-container" aria-label="Code Snippet Text">
<pre><code>{{code[codeFile]}}</code></pre>
</div>
</div>
Expand Down
14 changes: 4 additions & 10 deletions packages/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@
"downlevelIteration": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
"typeRoots": ["./node_modules/@types"],
"lib": ["es2017", "dom"]
},
"include": [
"src/**/*"
],
"include": ["src/**/*"],
"exclude": ["./node_modules", "../../node_modules"],
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
Expand Down
Loading

0 comments on commit 97c6fcd

Please sign in to comment.