Browse Source

move widget utils to components package

pull/10082/head
mehmet-erim 5 years ago
parent
commit
eefb875d78
  1. 4
      npm/ng-packs/packages/components/chart.js/src/widget-utils.ts
  2. 1
      npm/ng-packs/packages/theme-shared/src/lib/utils/index.ts
  3. 16
      npm/ng-packs/packages/theme-shared/src/lib/utils/widget-utils.ts

4
npm/ng-packs/packages/components/chart.js/src/widget-utils.ts

@ -1,5 +1,3 @@
import { ReplaySubject } from 'rxjs';
export function getRandomBackgroundColor(count) {
const colors = [];
@ -12,5 +10,3 @@ export function getRandomBackgroundColor(count) {
return colors;
}
export const chartJsLoaded$ = new ReplaySubject(1);

1
npm/ng-packs/packages/theme-shared/src/lib/utils/index.ts

@ -1,3 +1,2 @@
export * from './date-parser-formatter';
export * from './validation-utils';
export * from './widget-utils';

16
npm/ng-packs/packages/theme-shared/src/lib/utils/widget-utils.ts

@ -1,16 +0,0 @@
import { ReplaySubject } from 'rxjs';
export function getRandomBackgroundColor(count) {
const colors = [];
for (let i = 0; i < count; i++) {
const r = ((i + 5) * (i + 5) * 474) % 255;
const g = ((i + 5) * (i + 5) * 1600) % 255;
const b = ((i + 5) * (i + 5) * 84065) % 255;
colors.push('rgba(' + r + ', ' + g + ', ' + b + ', 0.7)');
}
return colors;
}
export const chartJsLoaded$ = new ReplaySubject(1);
Loading…
Cancel
Save