ngx-axis-appforge 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-axis-appforge-axis-components-cytoscape-design.mjs +44 -3
- package/fesm2022/ngx-axis-appforge-axis-components-cytoscape-design.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-cytoscape.mjs +38 -0
- package/fesm2022/ngx-axis-appforge-axis-components-cytoscape.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngx-axis-appforge-axis-components-cytoscape.d.ts +5 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FunFieldValueBase, baseFbConfig, baseFunField, BaseDesignSetting, FunField, DynamicDirective, OptionsNode, SimpleMenu } from 'ngx-axis-appforge/core';
|
|
1
|
+
import { FunFieldValueBase, baseFbConfig, baseFunField, BaseDesignSetting, FunField, DynamicDirective, InputTrigger, FormValidators, OptionsNode, SimpleMenu } from 'ngx-axis-appforge/core';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ChangeDetectionStrategy, Component, inject, forwardRef } from '@angular/core';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
6
|
import * as i4 from 'ng-zorro-antd/collapse';
|
|
7
7
|
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
8
8
|
import * as i3 from 'ng-zorro-antd/form';
|
|
@@ -28,8 +28,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
28
28
|
args: [{ selector: 'axis-design-cytoscape-setting', imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, DynamicDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u914D\u7F6E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"data\" #dataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>" }]
|
|
29
29
|
}] });
|
|
30
30
|
|
|
31
|
+
class SetOvertNodesHandler extends FunFieldValueBase {
|
|
32
|
+
noListen = inject(InputTrigger).noListen;
|
|
33
|
+
sendInitValue = true;
|
|
34
|
+
fg = this.fb.group({
|
|
35
|
+
ids: [undefined, FormValidators.requiredFun],
|
|
36
|
+
});
|
|
37
|
+
funFields = {
|
|
38
|
+
ids: {
|
|
39
|
+
defaultValue: [],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: SetOvertNodesHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.12", type: SetOvertNodesHandler, isStandalone: true, selector: "axis-modal-design-set-overt-nodes-handler", providers: [
|
|
44
|
+
{
|
|
45
|
+
provide: NG_VALUE_ACCESSOR,
|
|
46
|
+
useExisting: forwardRef(() => SetOvertNodesHandler),
|
|
47
|
+
multi: true
|
|
48
|
+
}
|
|
49
|
+
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n \u8282\u70B9ID\u5217\u8868\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"ids\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i2.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i2.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap", "nzSize", "nzVariant", "nzRequiredMark"], exportAs: ["nzForm"] }, { kind: "component", type: i3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign", "forceRenderOnChange"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: SetOvertNodesHandler, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{ selector: 'axis-modal-design-set-overt-nodes-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, DynamicDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
54
|
+
{
|
|
55
|
+
provide: NG_VALUE_ACCESSOR,
|
|
56
|
+
useExisting: forwardRef(() => SetOvertNodesHandler),
|
|
57
|
+
multi: true
|
|
58
|
+
}
|
|
59
|
+
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n \u8282\u70B9ID\u5217\u8868\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"ids\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
60
|
+
}] });
|
|
61
|
+
|
|
31
62
|
const Config = {
|
|
32
63
|
componentName: "Cytoscape",
|
|
64
|
+
eventHandlerDescs: {
|
|
65
|
+
setOvertNodes: {
|
|
66
|
+
name: "setOvertNodes",
|
|
67
|
+
title: "设置高亮节点",
|
|
68
|
+
dataComponent: SetOvertNodesHandler,
|
|
69
|
+
icon: "flag",
|
|
70
|
+
target: "component",
|
|
71
|
+
targetComponent: "axis-components/cytoscape",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
33
74
|
buildOptionsNodes(nextInfo) {
|
|
34
75
|
return {
|
|
35
76
|
treeNode: new OptionsNode({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-cytoscape-design.mjs","sources":["../../../axis-components/cytoscape/design/setting/setting.ts","../../../axis-components/cytoscape/design/setting/setting.html","../../../axis-components/cytoscape/design/config.ts","../../../axis-components/cytoscape/design/ngx-axis-appforge-axis-components-cytoscape-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzCollapseModule } from 'ng-zorro-antd/collapse';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, DynamicDirective, FunField, FunFieldOptions, FunFieldValueBase } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-design-cytoscape-setting',\n imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, DynamicDirective],\n templateUrl: './setting.html',\n styleUrl: './setting.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Setting extends FunFieldValueBase {\n\n override fg: UntypedFormGroup = this.fb.group({\n ...baseFbConfig,\n data: []\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n data: {\n defaultValue: undefined\n }\n };\n}\n","<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"基本设置\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n 配置\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"data\" #dataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, nameCode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\n\nexport const Config: DesignConfig = {\n\n componentName: \"Cytoscape\",\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: \"Cytoscape\",\n canSetting: true,\n canDrag: true,\n dragType: \"component\",\n parentObj: nextInfo.parentObject,\n indexOfParentObj: nextInfo.indexOfParent,\n rootOptions: nextInfo.currentObject,\n settingType: Setting,\n contextMenu: SimpleMenu,\n icon: \"node-index\"\n })\n };\n },\n bindElementsOptionsNode(element: HTMLElement, options: any): DesignBindElementsResult {\n return {\n [options.id]: { element }\n }\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './config';\n"],"names":[],"mappings":";;;;;;;;;;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A,EAAA,CAAA;kBAPnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,WAChC,CAAC,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,gBAAgB,CAAC,EAAA,eAAA,EAGzG,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,k3BAAA,EAAA;;;AER1C,MAAM,MAAM,GAAiB;AAEhC,IAAA,aAAa,EAAE,WAAW;AAC1B,IAAA,iBAAiB,CAAC,QAAkB,EAAA;QAChC,OAAO;YACH,QAAQ,EAAE,IAAI,WAAW,CAAC;gBACtB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;AACzB,gBAAA,IAAI,EAAE,WAAW;AACjB,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,QAAQ,CAAC,YAAY;gBAChC,gBAAgB,EAAE,QAAQ,CAAC,aAAa;gBACxC,WAAW,EAAE,QAAQ,CAAC,aAAa;AACnC,gBAAA,WAAW,EAAE,OAAO;AACpB,gBAAA,WAAW,EAAE,UAAU;AACvB,gBAAA,IAAI,EAAE;aACT;SACJ;IACL,CAAC;IACD,uBAAuB,CAAC,OAAoB,EAAE,OAAY,EAAA;QACtD,OAAO;AACH,YAAA,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO;SAC1B;IACL,CAAC;;;AC5BL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-cytoscape-design.mjs","sources":["../../../axis-components/cytoscape/design/setting/setting.ts","../../../axis-components/cytoscape/design/setting/setting.html","../../../axis-components/cytoscape/design/set-overt-nodes-handler/set-overt-nodes-handler.ts","../../../axis-components/cytoscape/design/set-overt-nodes-handler/set-overt-nodes-handler.html","../../../axis-components/cytoscape/design/config.ts","../../../axis-components/cytoscape/design/ngx-axis-appforge-axis-components-cytoscape-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzCollapseModule } from 'ng-zorro-antd/collapse';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, DynamicDirective, FunField, FunFieldOptions, FunFieldValueBase } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-design-cytoscape-setting',\n imports: [FormsModule, NzFormModule, ReactiveFormsModule, NzCollapseModule, BaseDesignSetting, FunField, DynamicDirective],\n templateUrl: './setting.html',\n styleUrl: './setting.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Setting extends FunFieldValueBase {\n\n override fg: UntypedFormGroup = this.fb.group({\n ...baseFbConfig,\n data: []\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n data: {\n defaultValue: undefined\n }\n };\n}\n","<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"基本设置\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n 配置\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"data\" #dataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n </nz-collapse>\n</form>","import { ChangeDetectionStrategy, Component, forwardRef, inject } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { DynamicDirective, FormValidators, FunField, FunFieldOptions, FunFieldValueBase, InputTrigger } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-modal-design-set-overt-nodes-handler',\n imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, DynamicDirective],\n templateUrl: './set-overt-nodes-handler.html',\n styleUrl: './set-overt-nodes-handler.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SetOvertNodesHandler),\n multi: true\n }\n ]\n})\nexport class SetOvertNodesHandler extends FunFieldValueBase {\n readonly noListen = inject(InputTrigger).noListen;\n protected override sendInitValue: boolean = true;\n override fg: UntypedFormGroup = this.fb.group({\n ids: [undefined, FormValidators.requiredFun],\n });\n\n protected override funFields: FunFieldOptions = {\n ids: {\n defaultValue: [],\n },\n };\n\n}\n","<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n 节点ID列表\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"ids\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" ngModel\n [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, nameCode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\nimport { SetOvertNodesHandler } from \"./set-overt-nodes-handler/set-overt-nodes-handler\";\n\nexport const Config: DesignConfig = {\n\n componentName: \"Cytoscape\",\n eventHandlerDescs: {\n setOvertNodes: {\n name: \"setOvertNodes\",\n title: \"设置高亮节点\",\n dataComponent: SetOvertNodesHandler,\n icon: \"flag\",\n target: \"component\",\n targetComponent: \"axis-components/cytoscape\",\n },\n },\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: \"Cytoscape\",\n canSetting: true,\n canDrag: true,\n dragType: \"component\",\n parentObj: nextInfo.parentObject,\n indexOfParentObj: nextInfo.indexOfParent,\n rootOptions: nextInfo.currentObject,\n settingType: Setting,\n contextMenu: SimpleMenu,\n icon: \"node-index\"\n })\n };\n },\n bindElementsOptionsNode(element: HTMLElement, options: any): DesignBindElementsResult {\n return {\n [options.id]: { element }\n }\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './config';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;AAaM,MAAO,OAAQ,SAAQ,iBAAiB,CAAA;AAEnC,IAAA,EAAE,GAAqB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC5C,QAAA,GAAG,YAAY;AACf,QAAA,IAAI,EAAE;AACP,KAAA,CAAC;AAEiB,IAAA,SAAS,GAAoB;AAC9C,QAAA,GAAG,YAAY;AACf,QAAA,IAAI,EAAE;AACJ,YAAA,YAAY,EAAE;AACf;KACF;wGAZU,OAAO,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAP,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,+BAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECbpB,k3BAiBO,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDTK,WAAW,+mBAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,cAAA,EAAA,QAAA,EAAA,+CAAA,EAAA,MAAA,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A,IAAI,EAAE,WAAW;AACjB,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,QAAQ,CAAC,YAAY;gBAChC,gBAAgB,EAAE,QAAQ,CAAC,aAAa;gBACxC,WAAW,EAAE,QAAQ,CAAC,aAAa;AACnC,gBAAA,WAAW,EAAE,OAAO;AACpB,gBAAA,WAAW,EAAE,UAAU;AACvB,gBAAA,IAAI,EAAE;aACT;SACJ;IACL,CAAC;IACD,uBAAuB,CAAC,OAAoB,EAAE,OAAY,EAAA;QACtD,OAAO;AACH,YAAA,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO;SAC1B;IACL,CAAC;;;ACvCL;;AAEG;;;;"}
|
|
@@ -3,6 +3,7 @@ import { effect, inject, ElementRef, ChangeDetectionStrategy, Component } from '
|
|
|
3
3
|
import { DataOptions, Base } from 'ngx-axis-appforge/core';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import cytoscape from 'cytoscape';
|
|
6
|
+
import { of } from 'rxjs';
|
|
6
7
|
|
|
7
8
|
class CytoscapeOptions extends DataOptions {
|
|
8
9
|
}
|
|
@@ -17,6 +18,7 @@ class Cytoscape extends Base {
|
|
|
17
18
|
options = new CytoscapeOptions();
|
|
18
19
|
container = inject(ElementRef);
|
|
19
20
|
cy;
|
|
21
|
+
overtNodeids;
|
|
20
22
|
ngAfterContentInit() {
|
|
21
23
|
this.render();
|
|
22
24
|
}
|
|
@@ -32,6 +34,42 @@ class Cytoscape extends Base {
|
|
|
32
34
|
container: c,
|
|
33
35
|
...this.options.data()
|
|
34
36
|
});
|
|
37
|
+
this.setOvertNodes(this.overtNodeids);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
onEvents(e) {
|
|
41
|
+
const obs = super.onEvents?.(e);
|
|
42
|
+
if (obs) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
switch (e.name) {
|
|
46
|
+
case "setOvertNodes":
|
|
47
|
+
this.setOvertNodes(e.data?.ids);
|
|
48
|
+
return of(true);
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
setOvertNodes(ids) {
|
|
53
|
+
if (!this.cy) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.overtNodeids = ids;
|
|
57
|
+
if (ids) {
|
|
58
|
+
this.cy.elements().style("opacity", 0.5);
|
|
59
|
+
if (ids.length) {
|
|
60
|
+
const nodes = this.cy.nodes(ids.map(id => `#${id}`).join(","));
|
|
61
|
+
nodes.style("opacity", 1);
|
|
62
|
+
this.cy.animate({
|
|
63
|
+
zoom: 2,
|
|
64
|
+
center: { eles: nodes },
|
|
65
|
+
fit: nodes.length > 1 ? { eles: nodes, padding: 50 } : undefined,
|
|
66
|
+
duration: 300,
|
|
67
|
+
easing: "ease-in-out"
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.cy?.elements().style("opacity", 1);
|
|
35
73
|
}
|
|
36
74
|
}
|
|
37
75
|
ngOnDestroy() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-cytoscape.mjs","sources":["../../../axis-components/cytoscape/cytoscape.options.ts","../../../axis-components/cytoscape/cytoscape.ts","../../../axis-components/cytoscape/cytoscape.html","../../../axis-components/cytoscape/ngx-axis-appforge-axis-components-cytoscape.ts"],"sourcesContent":["import { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class CytoscapeOptions extends DataOptions {\n}","import { AfterContentInit, ChangeDetectionStrategy, Component, effect, ElementRef, inject, OnDestroy
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-cytoscape.mjs","sources":["../../../axis-components/cytoscape/cytoscape.options.ts","../../../axis-components/cytoscape/cytoscape.ts","../../../axis-components/cytoscape/cytoscape.html","../../../axis-components/cytoscape/ngx-axis-appforge-axis-components-cytoscape.ts"],"sourcesContent":["import { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class CytoscapeOptions extends DataOptions {\n}","import { AfterContentInit, ChangeDetectionStrategy, Component, effect, ElementRef, inject, OnDestroy } from '@angular/core';\nimport { CytoscapeOptions } from './cytoscape.options';\nimport { Base, EventHandlerOptions } from 'ngx-axis-appforge/core';\nimport { CommonModule } from '@angular/common';\nimport cytoscape from 'cytoscape';\nimport { Observable, of } from 'rxjs';\n\n@Component({\n selector: 'axis-cytoscape',\n imports: [CommonModule],\n templateUrl: './cytoscape.html',\n styleUrl: './cytoscape.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Cytoscape extends Base<CytoscapeOptions> implements AfterContentInit, OnDestroy {\n\n constructor() {\n super();\n effect(() => {\n this.render();\n })\n }\n\n override options: CytoscapeOptions = new CytoscapeOptions();\n\n readonly container = inject(ElementRef);\n\n cy?: cytoscape.Core;\n\n overtNodeids?: string[];\n\n ngAfterContentInit(): void {\n this.render();\n }\n\n private render() {\n if (this.options.data()) {\n this.cy?.destroy();\n this.container.nativeElement.innerHTML = \"\";\n const c = document.createElement(\"div\");\n c.style.width = \"100%\";\n c.style.height = \"100%\";\n this.container.nativeElement.appendChild(c);\n this.cy = cytoscape({\n container: c,\n ...this.options.data()\n });\n this.setOvertNodes(this.overtNodeids);\n }\n }\n\n override onEvents(e: EventHandlerOptions<any>): Observable<boolean> | undefined {\n const obs = super.onEvents?.(e);\n if (obs) {\n return;\n }\n switch (e.name) {\n case \"setOvertNodes\":\n this.setOvertNodes(e.data?.ids);\n return of(true);\n }\n return undefined;\n }\n\n private setOvertNodes(ids: string[] | undefined) {\n if (!this.cy) {\n return;\n }\n this.overtNodeids = ids;\n if (ids) {\n this.cy.elements().style(\"opacity\", 0.5);\n if (ids.length) {\n const nodes = this.cy.nodes(ids.map(id => `#${id}`).join(\",\"));\n nodes.style(\"opacity\", 1);\n this.cy.animate({\n zoom: 2,\n center: { eles: nodes },\n fit: nodes.length > 1 ? { eles: nodes, padding: 50 } : undefined,\n duration: 300,\n easing: \"ease-in-out\"\n });\n }\n } else {\n this.cy?.elements().style(\"opacity\", 1);\n }\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.cy?.destroy();\n }\n}\n","","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './cytoscape';\n"],"names":[],"mappings":";;;;;;;AAEM,MAAO,gBAAiB,SAAQ,WAAW,CAAA;AAChD;;ACWK,MAAO,SAAU,SAAQ,IAAsB,CAAA;AAEnD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QACP,MAAM,CAAC,MAAK;YACV,IAAI,CAAC,MAAM,EAAE;AACf,QAAA,CAAC,CAAC;IACJ;AAES,IAAA,OAAO,GAAqB,IAAI,gBAAgB,EAAE;AAElD,IAAA,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC,IAAA,EAAE;AAEF,IAAA,YAAY;IAEZ,kBAAkB,GAAA;QAChB,IAAI,CAAC,MAAM,EAAE;IACf;IAEQ,MAAM,GAAA;AACZ,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;AACvB,YAAA,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;YAClB,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,GAAG,EAAE;YAC3C,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACvC,YAAA,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM;AACtB,YAAA,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM;YACvB,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,YAAA,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC;AAClB,gBAAA,SAAS,EAAE,CAAC;AACZ,gBAAA,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI;AACrB,aAAA,CAAC;AAC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oBAAA,MAAM,EAAE;AACT,iBAAA,CAAC;YACJ;QACF;aAAO;AACL,YAAA,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QACzC;IACF;IAES,WAAW,GAAA;QAClB,KAAK,CAAC,WAAW,EAAE;AACnB,QAAA,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;IACpB;wGA5EW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECdtB,EAAA,EAAA,MAAA,EAAA,CAAA,+CAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDSY,YAAY,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAKX,SAAS,EAAA,UAAA,EAAA,CAAA;kBAPrB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,WACjB,CAAC,YAAY,CAAC,EAAA,eAAA,EAGN,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,EAAA,EAAA,MAAA,EAAA,CAAA,+CAAA,CAAA,EAAA;;;AEZjD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { AfterContentInit, OnDestroy, ElementRef } from '@angular/core';
|
|
3
|
-
import { DataOptions, Base } from 'ngx-axis-appforge/core';
|
|
3
|
+
import { DataOptions, Base, EventHandlerOptions } from 'ngx-axis-appforge/core';
|
|
4
4
|
import cytoscape from 'cytoscape';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
5
6
|
|
|
6
7
|
declare class CytoscapeOptions extends DataOptions {
|
|
7
8
|
}
|
|
@@ -11,8 +12,11 @@ declare class Cytoscape extends Base<CytoscapeOptions> implements AfterContentIn
|
|
|
11
12
|
options: CytoscapeOptions;
|
|
12
13
|
readonly container: ElementRef<any>;
|
|
13
14
|
cy?: cytoscape.Core;
|
|
15
|
+
overtNodeids?: string[];
|
|
14
16
|
ngAfterContentInit(): void;
|
|
15
17
|
private render;
|
|
18
|
+
onEvents(e: EventHandlerOptions<any>): Observable<boolean> | undefined;
|
|
19
|
+
private setOvertNodes;
|
|
16
20
|
ngOnDestroy(): void;
|
|
17
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<Cytoscape, never>;
|
|
18
22
|
static ɵcmp: i0.ɵɵComponentDeclaration<Cytoscape, "axis-cytoscape", never, {}, {}, never, never, true, never>;
|