-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(echarts): Add treemap as a chart option to Covalent E-Charts * fix linting * removing json data file * removing config options that are handled in series component now * feat(): reformat demo example and rename TreeMap to Treemap * feat(): demo [leafDepth]="2" in treemap
- Loading branch information
1 parent
466c29e
commit 7bc3c21
Showing
14 changed files
with
1,308 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
348 changes: 348 additions & 0 deletions
348
src/app/components/types/treemap/treemap.component.html
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'types-treemap', | ||
templateUrl: './treemap.component.html', | ||
styleUrls: ['./treemap.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
preserveWhitespaces: true, | ||
}) | ||
export class TypesTreemapComponent { | ||
// Series data | ||
data: any = [ | ||
{ | ||
value: 40, | ||
name: 'Accessibility', | ||
path: 'Accessibility', | ||
}, | ||
{ | ||
value: 180, | ||
name: 'Accounts', | ||
path: 'Accounts', | ||
children: [ | ||
{ | ||
value: 76, | ||
name: 'Access', | ||
path: 'Accounts/Access', | ||
children: [ | ||
{ | ||
value: 12, | ||
name: 'DefaultAccessPlugin.bundle', | ||
path: 'Accounts/Access/DefaultAccessPlugin.bundle', | ||
}, | ||
{ | ||
value: 28, | ||
name: 'FacebookAccessPlugin.bundle', | ||
path: 'Accounts/Access/FacebookAccessPlugin.bundle', | ||
}, | ||
{ | ||
value: 20, | ||
name: 'LinkedInAccessPlugin.bundle', | ||
path: 'Accounts/Access/LinkedInAccessPlugin.bundle', | ||
}, | ||
{ | ||
value: 16, | ||
name: 'TencentWeiboAccessPlugin.bundle', | ||
path: 'Accounts/Access/TencentWeiboAccessPlugin.bundle', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 92, | ||
name: 'Authentication', | ||
path: 'Accounts/Authentication', | ||
children: [ | ||
{ | ||
value: 24, | ||
name: 'FacebookAuthenticationPlugin.bundle', | ||
path: 'Accounts/Authentication/FacebookAuthenticationPlugin.bundle', | ||
}, | ||
{ | ||
value: 16, | ||
name: 'LinkedInAuthenticationPlugin.bundle', | ||
path: 'Accounts/Authentication/LinkedInAuthenticationPlugin.bundle', | ||
}, | ||
{ | ||
value: 20, | ||
name: 'TencentWeiboAuthenticationPlugin.bundle', | ||
path: 'Accounts/Authentication/TencentWeiboAuthenticationPlugin.bundle', | ||
}, | ||
{ | ||
value: 16, | ||
name: 'TwitterAuthenticationPlugin.bundle', | ||
path: 'Accounts/Authentication/TwitterAuthenticationPlugin.bundle', | ||
}, | ||
{ | ||
value: 16, | ||
name: 'WeiboAuthenticationPlugin.bundle', | ||
path: 'Accounts/Authentication/WeiboAuthenticationPlugin.bundle', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 12, | ||
name: 'Notification', | ||
path: 'Accounts/Notification', | ||
children: [ | ||
{ | ||
value: 12, | ||
name: 'SPAAccountsNotificationPlugin.bundle', | ||
path: 'Accounts/Notification/SPAAccountsNotificationPlugin.bundle', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 1904, | ||
name: 'AddressBook Plug-Ins', | ||
path: 'AddressBook Plug-Ins', | ||
children: [ | ||
{ | ||
value: 744, | ||
name: 'CardDAVPlugin.sourcebundle', | ||
path: 'AddressBook Plug-Ins/CardDAVPlugin.sourcebundle', | ||
children: [ | ||
{ | ||
value: 744, | ||
name: 'Contents', | ||
path: 'AddressBook Plug-Ins/CardDAVPlugin.sourcebundle/Contents', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 28, | ||
name: 'DirectoryServices.sourcebundle', | ||
path: 'AddressBook Plug-Ins/DirectoryServices.sourcebundle', | ||
children: [ | ||
{ | ||
value: 28, | ||
name: 'Contents', | ||
path: 'AddressBook Plug-Ins/DirectoryServices.sourcebundle/Contents', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 680, | ||
name: 'Exchange.sourcebundle', | ||
path: 'AddressBook Plug-Ins/Exchange.sourcebundle', | ||
children: [ | ||
{ | ||
value: 680, | ||
name: 'Contents', | ||
path: 'AddressBook Plug-Ins/Exchange.sourcebundle/Contents', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 432, | ||
name: 'LDAP.sourcebundle', | ||
path: 'AddressBook Plug-Ins/LDAP.sourcebundle', | ||
children: [ | ||
{ | ||
value: 432, | ||
name: 'Contents', | ||
path: 'AddressBook Plug-Ins/LDAP.sourcebundle/Contents', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 20, | ||
name: 'LocalSource.sourcebundle', | ||
path: 'AddressBook Plug-Ins/LocalSource.sourcebundle', | ||
children: [ | ||
{ | ||
value: 20, | ||
name: 'Contents', | ||
path: 'AddressBook Plug-Ins/LocalSource.sourcebundle/Contents', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
// CHART JS Config object | ||
config: any = { | ||
grid: { borderColor: 'transparent' }, | ||
xAxis: { show: false }, | ||
yAxis: { show: false }, | ||
series: [ | ||
{ | ||
type: 'treemap', | ||
data: this.data, | ||
|
||
top: '10%', | ||
left: '10%', | ||
bottom: '10%', | ||
right: '10%', | ||
itemStyle: { | ||
normal: { | ||
borderColor: '#fff', | ||
}, | ||
}, | ||
levels: [{ itemStyle: { normal: { borderWidth: 0, gapWidth: 5 } } }, | ||
{ itemStyle: { normal: { gapWidth: 1 } } }, | ||
{ colorSaturation: [0.35, 0.5], itemStyle: { normal: { gapWidth: 1, borderColorSaturation: 0.6 } } }, | ||
], | ||
label: { | ||
show: true, | ||
formatter: '{b}', | ||
}, | ||
}, | ||
], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.