From 6ea6c2c55e35db4825cf144f4f7dc2fdf4120fca Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Sat, 12 Apr 2025 09:50:56 +0530 Subject: [PATCH] tree --- .../wireframe-renderer.component.html | 22 +++++++ .../wireframe-renderer.component.scss | 10 ++++ .../wireframe-renderer.component.ts | 18 ++++++ .../tree-visualizer.component.html | 54 +++++++++++++++-- .../tree-visualizer.component.scss | 58 +++++++++++++++++++ .../tree-visualizer.component.ts | 11 ++++ 6 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.html create mode 100644 visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.scss create mode 100644 visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.ts diff --git a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.html b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.html new file mode 100644 index 0000000..6a1a35e --- /dev/null +++ b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.html @@ -0,0 +1,22 @@ + + +
+

{{ title }}

+ +
+
+

{{ key }}

+
{{ node[key] || 'Empty block' }}
+
+
+ + +
+ + +
+
+ \ No newline at end of file diff --git a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.scss b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.scss new file mode 100644 index 0000000..afb8f2c --- /dev/null +++ b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.scss @@ -0,0 +1,10 @@ +.wireframe-container { + font-family: Arial, sans-serif; + background: #f8f8f8; + padding: 1rem; + } + + .border-dashed { + border-style: dashed; + } + \ No newline at end of file diff --git a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.ts b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.ts new file mode 100644 index 0000000..cd7cb55 --- /dev/null +++ b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/WireframesUi/wireframe-renderer.component.ts @@ -0,0 +1,18 @@ +// wireframe-renderer.component.ts +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'app-wireframe-renderer', + templateUrl: './wireframe-renderer.component.html', + styleUrls: ['./wireframe-renderer.component.scss'] +}) +export class WireframeRendererComponent { + @Input() node: any; + @Input() title: string = ''; + + // wireframe-renderer.component.ts (add this helper method) + getKeys(obj: any): string[] { + return Object.keys(obj || {}); + } + +} diff --git a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.html b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.html index 61dfe44..974eae4 100644 --- a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.html +++ b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.html @@ -14,7 +14,8 @@ --> - + + + +
+ + +
+ + +
+
+ + +
+ +
+ +
+ +
+ +
+
+ + +
+
+ +

Generate JSON

+ + +
+
diff --git a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.scss b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.scss index 693071c..a0cf891 100644 --- a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.scss +++ b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.scss @@ -27,3 +27,61 @@ .controls button:hover { background-color: #1565c0; } + +.toolbar { + display: flex; + gap: 10px; + align-items: flex-start; + padding: 1rem; + background-color: #f7f7f7; +} + +textarea { + width: 300px; + height: 120px; + font-family: monospace; + padding: 10px; + border-radius: 8px; + border: 1px solid #ccc; +} + +button { + padding: 10px 20px; + background-color: #3f51b5; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +button:hover { + background-color: #303f9f; +} + +mat-tab-group { + margin: 1rem; +} + +.tab-content { + padding: 1rem; + background-color: #fafafa; + border: 1px solid #ddd; + border-radius: 10px; + min-height: 400px; +} + +.tab-button { + padding: 10px 20px; + border: none; + background: none; + cursor: pointer; + border-bottom: 2px solid transparent; + font-weight: bold; +} + +.active-tab { + border-bottom: 2px solid #007bff; + color: #007bff; +} + diff --git a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.ts b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.ts index 83d4cea..6249a5e 100644 --- a/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.ts +++ b/visaproject-front-f/authsec_angular/frontend/angular-clarity-master/src/app/modules/main/fnd/SiteTreeBuilder/tree-visualizer.component.ts @@ -2,12 +2,16 @@ import { Component } from '@angular/core'; import { treeVisualizerService } from './tree-visualizer.service'; + @Component({ selector: 'app-tree-visualizer', templateUrl: './tree-visualizer.component.html', styleUrls: ['./tree-visualizer.component.scss'] }) export class TreeVisualizerComponent { + + activeTab: 'sitemap' | 'wireframe' = 'sitemap'; + showPopup: boolean = false; inputJson: string = ''; treeData: any = null; rawInputText: string = `make a website , where we can login , sign up. @@ -16,6 +20,13 @@ after click this icard inside we upload excel of student data, icard template, a constructor(private treeService: treeVisualizerService) { } + + + openPopup() { + this.showPopup = true; + } + + convertJson() { try { const parsed = JSON.parse(this.inputJson);