Skip to content

Commit 750dd0c

Browse files
committed
added missing config generators
1 parent ba7201c commit 750dd0c

17 files changed

+743
-673
lines changed

Diff for: live-editing/LiveEditingManager.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ class LiveEditingManager {
1616
fs.mkdirSync(ASSETS_SAMPLES_DIR);
1717
fs.mkdirSync(ASSETS_SAMPLES_CSS_SUPPORT_DIR);
1818

19-
console.log("Live-Editing... CSS with logs:");
20-
this._run(StyleSyntax.CSS, false);
21-
console.log("Live-Editing... SASS without logs:");
22-
this._run(StyleSyntax.Sass, false);
19+
this.generate(StyleSyntax.CSS, false);
20+
this.generate(StyleSyntax.Sass, false);
2321
}
2422

25-
public _run(styleSyntax: StyleSyntax, showLogs?: boolean) {
23+
private generate(styleSyntax: StyleSyntax, showLogs?: boolean) {
24+
25+
let logInfo = "";
26+
if (styleSyntax === StyleSyntax.CSS) {
27+
logInfo = "CSS syntax"
28+
} else {
29+
logInfo = "Sass syntax"
30+
}
31+
console.log("Live-Editing... " + logInfo);
32+
2633
new SharedAssetsGenerator(styleSyntax, showLogs).generateSharedAssets();
2734
new SampleAssetsGenerator(styleSyntax, showLogs).generateSamplesAssets();
2835
new MetaDataGenerator(styleSyntax).Generate();

Diff for: live-editing/configs/CategoryChartConfigGenerator.ts

+68-145
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,80 @@
11
/* tslint:disable:object-literal-sort-keys */
2+
// tslint:disable:object-literal-shorthand
3+
// tslint:disable:max-line-length
4+
// tslint:disable:member-ordering
5+
// tslint:disable:prefer-const
26
import { IgxSliderModule } from "igniteui-angular";
37
import { IgxCategoryChartModule } from "igniteui-angular-charts/ES5/igx-category-chart-module";
4-
import {
5-
CategoryChartAnnotationsComponent
6-
} from "../../src/app/charts/category-chart/annotations/category-chart-annotations.component";
7-
import {
8-
CategoryChartAxisOptionsComponent
9-
} from "../../src/app/charts/category-chart/axis-options/category-chart-axis-options-sample.component";
10-
import {
11-
CategoryChartConfigOptionsComponent
12-
} from "../../src/app/charts/category-chart/config-options/category-chart-config-options-sample.component";
13-
import {
14-
CategoryChartHighFrequencyComponent
15-
} from "../../src/app/charts/category-chart/high-frequency/category-chart-high-frequency-sample.component";
16-
import {
17-
CategoryChartHighVolumeComponent
18-
} from "../../src/app/charts/category-chart/high-volume/category-chart-high-volume-sample.component";
19-
import {
20-
CategoryChartHighlightingComponent
21-
} from "../../src/app/charts/category-chart/highlighting/category-chart-highlighting.component";
22-
import {
23-
CategoryChartOverlapColumnsComponent
24-
} from "../../src/app/charts/category-chart/overlap-columns/category-chart-overlap-columns.component";
25-
import {
26-
CategoryChartOverviewComponent
27-
} from "../../src/app/charts/category-chart/overview/category-chart-overview-sample.component";
28-
import {
29-
CategoryChartTooltipTemplateComponent
30-
} from "../../src/app/charts/category-chart/tooltip-template/category-chart-tooltip-template.component";
31-
import {
32-
CategoryChartTooltipTypesComponent
33-
} from "../../src/app/charts/category-chart/tooltip-types/category-chart-tooltip-types.component";
34-
import {
35-
CategoryChartTrendlinesComponent
36-
} from "../../src/app/charts/category-chart/trendline/category-chart-trendlines.component";
8+
9+
import { CategoryChartAnnotationsComponent } from "../../src/app/charts/category-chart/annotations/category-chart-annotations.component";
10+
import { CategoryChartAxisOptionsComponent } from "../../src/app/charts/category-chart/axis-options/category-chart-axis-options-sample.component";
11+
import { CategoryChartConfigOptionsComponent } from "../../src/app/charts/category-chart/config-options/category-chart-config-options-sample.component";
12+
import { CategoryChartHighFrequencyComponent } from "../../src/app/charts/category-chart/high-frequency/category-chart-high-frequency-sample.component";
13+
import { CategoryChartHighVolumeComponent } from "../../src/app/charts/category-chart/high-volume/category-chart-high-volume-sample.component";
14+
import { CategoryChartHighlightingComponent } from "../../src/app/charts/category-chart/highlighting/category-chart-highlighting.component";
15+
import { CategoryChartOverlapColumnsComponent } from "../../src/app/charts/category-chart/overlap-columns/category-chart-overlap-columns.component";
16+
import { CategoryChartOverviewComponent } from "../../src/app/charts/category-chart/overview/category-chart-overview-sample.component";
17+
import { CategoryChartTooltipTemplateComponent } from "../../src/app/charts/category-chart/tooltip-template/category-chart-tooltip-template.component";
18+
import { CategoryChartTooltipTypesComponent } from "../../src/app/charts/category-chart/tooltip-types/category-chart-tooltip-types.component";
19+
import { CategoryChartTrendlinesComponent } from "../../src/app/charts/category-chart/trendline/category-chart-trendlines.component";
20+
3721
import { DependenciesType } from "../services/DependenciesType";
38-
import { AppModuleConfig } from "./core/AppModuleConfig";
3922
import { Config } from "./core/Config";
40-
import { IConfigGenerator } from "./core/IConfigGenerator";
23+
import { BaseConfigGenerator } from "./core/BaseConfigGenerator";
24+
25+
export class CategoryChartConfigGenerator extends BaseConfigGenerator {
26+
27+
constructor() {
28+
super(DependenciesType.Charts, "/charts/category-chart/");
29+
}
4130

42-
export class CategoryChartConfigGenerator implements IConfigGenerator {
4331
public generateConfigs(): Config[] {
4432
const configs = new Array<Config>();
4533

46-
configs.push(new Config({
47-
component: CategoryChartOverviewComponent,
48-
appModuleConfig: new AppModuleConfig({
49-
imports: [IgxCategoryChartModule, CategoryChartOverviewComponent],
50-
ngDeclarations: [CategoryChartOverviewComponent],
51-
ngImports: [IgxCategoryChartModule]
52-
}),
53-
dependenciesType: DependenciesType.Charts,
54-
shortenComponentPathBy: "/charts/category-chart/"
55-
}));
56-
57-
configs.push(new Config({
58-
component: CategoryChartHighVolumeComponent,
59-
appModuleConfig: new AppModuleConfig({
60-
imports: [IgxCategoryChartModule, CategoryChartHighVolumeComponent, IgxSliderModule],
61-
ngDeclarations: [CategoryChartHighVolumeComponent],
62-
ngImports: [IgxCategoryChartModule, IgxSliderModule]
63-
}),
64-
dependenciesType: DependenciesType.Charts,
65-
shortenComponentPathBy: "/charts/category-chart/"
66-
}));
67-
68-
configs.push(new Config({
69-
component: CategoryChartHighFrequencyComponent,
70-
appModuleConfig: new AppModuleConfig({
71-
imports: [IgxCategoryChartModule, CategoryChartHighFrequencyComponent, IgxSliderModule],
72-
ngDeclarations: [CategoryChartHighFrequencyComponent],
73-
ngImports: [IgxCategoryChartModule, IgxSliderModule]
74-
}),
75-
dependenciesType: DependenciesType.Charts,
76-
shortenComponentPathBy: "/charts/category-chart/"
77-
}));
78-
79-
configs.push(new Config({
80-
component: CategoryChartTooltipTemplateComponent,
81-
appModuleConfig: new AppModuleConfig({
82-
imports: [IgxCategoryChartModule, CategoryChartTooltipTemplateComponent],
83-
ngDeclarations: [CategoryChartTooltipTemplateComponent],
84-
ngImports: [IgxCategoryChartModule]
85-
}),
86-
dependenciesType: DependenciesType.Charts,
87-
shortenComponentPathBy: "/charts/category-chart/"
88-
}));
89-
90-
configs.push(new Config({
91-
component: CategoryChartConfigOptionsComponent,
92-
appModuleConfig: new AppModuleConfig({
93-
imports: [IgxCategoryChartModule, CategoryChartConfigOptionsComponent],
94-
ngDeclarations: [CategoryChartConfigOptionsComponent],
95-
ngImports: [IgxCategoryChartModule]
96-
}),
97-
dependenciesType: DependenciesType.Charts,
98-
shortenComponentPathBy: "/charts/category-chart/"
99-
}));
100-
101-
configs.push(new Config({
102-
component: CategoryChartAxisOptionsComponent,
103-
appModuleConfig: new AppModuleConfig({
104-
imports: [IgxCategoryChartModule, CategoryChartAxisOptionsComponent],
105-
ngDeclarations: [CategoryChartAxisOptionsComponent],
106-
ngImports: [IgxCategoryChartModule]
107-
}),
108-
dependenciesType: DependenciesType.Charts,
109-
shortenComponentPathBy: "/charts/category-chart/"
110-
}));
111-
112-
configs.push(new Config({
113-
component: CategoryChartAnnotationsComponent,
114-
appModuleConfig: new AppModuleConfig({
115-
imports: [IgxCategoryChartModule, CategoryChartAnnotationsComponent],
116-
ngDeclarations: [CategoryChartAnnotationsComponent],
117-
ngImports: [IgxCategoryChartModule]
118-
}),
119-
dependenciesType: DependenciesType.Charts,
120-
shortenComponentPathBy: "/charts/category-chart/"
121-
}));
122-
123-
configs.push(new Config({
124-
component: CategoryChartHighlightingComponent,
125-
appModuleConfig: new AppModuleConfig({
126-
imports: [IgxCategoryChartModule, CategoryChartHighlightingComponent],
127-
ngDeclarations: [CategoryChartHighlightingComponent],
128-
ngImports: [IgxCategoryChartModule]
129-
}),
130-
dependenciesType: DependenciesType.Charts,
131-
shortenComponentPathBy: "/charts/category-chart/"
132-
}));
133-
134-
configs.push(new Config({
135-
component: CategoryChartTooltipTypesComponent,
136-
appModuleConfig: new AppModuleConfig({
137-
imports: [IgxCategoryChartModule, CategoryChartTooltipTypesComponent],
138-
ngDeclarations: [CategoryChartTooltipTypesComponent],
139-
ngImports: [IgxCategoryChartModule]
140-
}),
141-
dependenciesType: DependenciesType.Charts,
142-
shortenComponentPathBy: "/charts/category-chart/"
143-
}));
144-
145-
configs.push(new Config({
146-
component: CategoryChartOverlapColumnsComponent,
147-
appModuleConfig: new AppModuleConfig({
148-
imports: [IgxCategoryChartModule, CategoryChartOverlapColumnsComponent],
149-
ngDeclarations: [CategoryChartOverlapColumnsComponent],
150-
ngImports: [IgxCategoryChartModule]
151-
}),
152-
dependenciesType: DependenciesType.Charts,
153-
shortenComponentPathBy: "/charts/category-chart/"
154-
}));
34+
configs.push(this.getConfig(
35+
CategoryChartOverviewComponent,
36+
[IgxCategoryChartModule]));
37+
38+
configs.push(this.getConfig(
39+
CategoryChartHighVolumeComponent,
40+
[IgxCategoryChartModule, IgxSliderModule]));
41+
42+
configs.push(this.getConfig(
43+
CategoryChartHighFrequencyComponent,
44+
[IgxCategoryChartModule, IgxSliderModule]));
45+
46+
configs.push(this.getConfig(
47+
CategoryChartTooltipTemplateComponent,
48+
[IgxCategoryChartModule]));
49+
50+
configs.push(this.getConfig(
51+
CategoryChartConfigOptionsComponent,
52+
[IgxCategoryChartModule]));
53+
54+
configs.push(this.getConfig(
55+
CategoryChartAxisOptionsComponent,
56+
[IgxCategoryChartModule]));
57+
58+
configs.push(this.getConfig(
59+
CategoryChartAnnotationsComponent,
60+
[IgxCategoryChartModule]));
61+
62+
configs.push(this.getConfig(
63+
CategoryChartHighlightingComponent,
64+
[IgxCategoryChartModule]));
65+
66+
configs.push(this.getConfig(
67+
CategoryChartTooltipTypesComponent,
68+
[IgxCategoryChartModule]));
69+
70+
configs.push(this.getConfig(
71+
CategoryChartOverlapColumnsComponent,
72+
[IgxCategoryChartModule]));
73+
74+
configs.push(this.getConfig(
75+
CategoryChartTrendlinesComponent,
76+
[IgxCategoryChartModule]));
77+
15578
return configs;
15679
}
15780
}

Diff for: live-editing/configs/DataChartConfigGenerator.ts

+15-46
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// tslint:disable:member-ordering
55
// tslint:disable:prefer-const
66
import { DataChartAxisLocationsComponent } from "../../src/app/charts/data-chart/data-chart-axis-locations/data-chart-axis-locations.component";
7+
import { DataChartAxisAnnotationsComponent } from "../../src/app/charts/data-chart/data-chart-axis-annotations/data-chart-axis-annotations.component";
78
import { DataChartAxisSettingsComponent } from "../../src/app/charts/data-chart/data-chart-axis-settings/data-chart-axis-settings.component";
89
import { DataChartAxisSharingComponent } from "../../src/app/charts/data-chart/data-chart-axis-sharing/data-chart-axis-sharing.component";
910
import { DataChartAxisTypesComponent } from "../../src/app/charts/data-chart/data-chart-axis-types/data-chart-axis-types.component";
@@ -32,12 +33,6 @@ import { DataChartTypeScatterShapeSeriesComponent } from "../../src/app/charts/d
3233
import { DataChartTypeStackedSeriesComponent } from "../../src/app/charts/data-chart/data-chart-type-stacked-series/data-chart-type-stacked-series.component";
3334
import { DataChartTypeValueOverlayComponent } from "../../src/app/charts/data-chart/data-chart-type-value-overlay/data-chart-type-value-overlay.component";
3435

35-
import { Type } from "@angular/core";
36-
import { DependenciesType } from "../services/DependenciesType";
37-
import { AppModuleConfig } from "./core/AppModuleConfig";
38-
import { Config } from "./core/Config";
39-
import { IConfigGenerator } from "./core/IConfigGenerator";
40-
4136
import { IgxCalloutLayerModule } from "igniteui-angular-charts/ES5/igx-callout-layer-module";
4237
// import { IgxCategoryToolTipLayer } from "igniteui-angular-charts/ES5/igx-category-tool-tip-layer";
4338
import { IgxCrosshairLayerModule } from "igniteui-angular-charts/ES5/igx-crosshair-layer-module";
@@ -105,12 +100,21 @@ import { SampleScatterStats } from "../../src/app/charts/data-chart/SampleScatte
105100
import { SampleShapeData } from "../../src/app/charts/data-chart/SampleShapeData";
106101
import { SharedData } from "../../src/app/charts/data-chart/SharedData";
107102

108-
export class DataChartConfigGenerator implements IConfigGenerator {
103+
import { DependenciesType } from "../services/DependenciesType";
104+
import { Config } from "./core/Config";
105+
import { BaseConfigGenerator } from "./core/BaseConfigGenerator";
106+
107+
export class DataChartConfigGenerator extends BaseConfigGenerator {
108+
109+
constructor() {
110+
super(DependenciesType.Charts, "/charts/data-chart/");
111+
}
109112

110113
public generateConfigs(): Config[] {
111114
const configs = new Array<Config>();
112115

113116
// using simpler config instead of default/complex config
117+
114118
configs.push(this.getConfig(
115119
DataChartAxisLocationsComponent,
116120
[IgxDataChartCoreModule, IgxDataChartCategoryModule, IgxLegendModule]));
@@ -154,17 +158,6 @@ export class DataChartConfigGenerator implements IConfigGenerator {
154158
[IgxDataChartCoreModule, IgxDataChartScatterCoreModule, IgxDataChartScatterModule,
155159
IgxNumberAbbreviatorModule, IgxDataChartInteractivityModule, IgxLegendModule ],
156160
[SampleScatterStats], ["/src/app/charts/data-chart/SampleScatterStats.ts"]));
157-
// configs.push(new Config({
158-
// additionalFiles: ["/src/app/charts/data-chart/SampleScatterStats.ts"],
159-
// component: DataChartOverviewComponent,
160-
// appModuleConfig: new AppModuleConfig({
161-
// imports: [IgxDataChartCoreModule, DataChartOverviewComponent, SampleScatterStats],
162-
// ngDeclarations: [DataChartOverviewComponent],
163-
// ngImports: [IgxDataChartCoreModule]
164-
// }),
165-
// dependenciesType: DependenciesType.Charts,
166-
// shortenComponentPathBy: "/charts/data-chart/"
167-
// }));
168161

169162
configs.push(this.getConfig(
170163
DataChartPerformanceComponent,
@@ -290,35 +283,11 @@ export class DataChartConfigGenerator implements IConfigGenerator {
290283
[IgxDataChartCoreModule, IgxDataChartCategoryModule],
291284
[SharedData], ["/src/app/charts/data-chart/SharedData.ts"]));
292285

286+
configs.push(this.getConfig(
287+
DataChartAxisAnnotationsComponent,
288+
[IgxDataChartCoreModule, IgxDataChartCategoryModule]));
289+
293290
return configs;
294291
}
295292

296-
// TODO copy this function to other *ChartConfigGenerator classes
297-
public getConfig(component: Type<any>, modules: any[], dataSources?: any[], dataPaths?: string[]) {
298-
const imports: any[] = [];
299-
imports.push(component); // add sample component for importing
300-
for (const m of modules) {
301-
imports.push(m); // add modules for importing
302-
}
303-
// add optional data sources
304-
if (dataSources !== undefined && dataSources.length > 0) {
305-
for (const ds of dataSources) {
306-
imports.push(ds);
307-
}
308-
}
309-
310-
const fields = {
311-
additionalFiles: dataPaths,
312-
component: component,
313-
appModuleConfig: new AppModuleConfig({
314-
imports: imports,
315-
ngDeclarations: [component],
316-
ngImports: modules
317-
}),
318-
dependenciesType: DependenciesType.Charts,
319-
shortenComponentPathBy: "/charts/data-chart/"
320-
// shortenComponentPathBy: "/charts/"
321-
};
322-
return new Config(fields);
323-
}
324293
}

0 commit comments

Comments
 (0)