Data Visualization Suite
Run ID: 69cb9c7d61b1021a29a8aa212026-03-31Analytics
PantheraHive BOS
BOS Dashboard

Data Visualization Suite: Research & Design Requirements

This document outlines the comprehensive design requirements for the Data Visualization Suite, serving as the foundational deliverable for the "research_design_requirements" step. Our goal is to create an intuitive, powerful, and aesthetically pleasing platform that empowers users to connect, transform, visualize, and share their data insights effectively.


1. Design Specifications

1.1. Core Functional Requirements

  • Data Ingestion & Connection:

* Support for various data sources: CSV, Excel, SQL databases (PostgreSQL, MySQL, SQL Server, Oracle), NoSQL databases (MongoDB), REST APIs, Google Sheets, cloud storage (S3, Azure Blob).

* Secure credential management and connection testing.

* Ability to schedule data refreshes.

  • Data Transformation & Preparation:

* Intuitive interface for data cleaning (handling missing values, duplicates).

* Data type conversion (string to number, date parsing).

* Aggregation functions (sum, average, count, min, max).

* Filtering, sorting, and grouping capabilities.

* Creation of calculated fields using a formula editor.

* Data blending from multiple sources.

  • Visualization Creation:

* Extensive library of chart types: Bar charts, Line charts, Area charts, Pie/Donut charts, Scatter plots, Bubble charts, Heatmaps, Treemaps, Sunburst charts, Gauge charts, Geographic maps.

* Drag-and-drop interface for assigning data fields to visual properties (axes, color, size, shape).

* Customization options for colors, labels, tooltips, axes, legends, and titles.

* Support for multiple measures/dimensions on a single chart.

  • Dashboard Creation & Interactivity:

* Canvas-based layout for arranging multiple visualizations.

* Responsive design for optimal viewing on various devices.

* Global and local filtering capabilities across dashboards.

* Drill-down and drill-through functionality.

* Interactive elements: tooltips, hover effects, cross-filtering.

  • Sharing & Collaboration:

* Secure sharing of dashboards via direct links with access control.

* Exporting visualizations/dashboards to various formats (PNG, JPG, PDF, CSV).

* Embedding dashboards into external applications (e.g., websites, intranets).

* Commenting and annotation features (future consideration).

  • User & Access Management:

* Role-based access control (Admin, Editor, Viewer).

* Secure user authentication (username/password, potentially SSO integration).

1.2. Technical Requirements

  • Scalability: Designed to handle large datasets and a growing number of users without performance degradation.
  • Performance: Fast data loading, query execution, and visualization rendering.
  • Security:

* End-to-end encryption for data in transit and at rest.

* Robust authentication and authorization mechanisms.

* Compliance with relevant data privacy regulations (e.g., GDPR, CCPA).

  • Cross-Browser Compatibility: Optimized for modern web browsers (Chrome, Firefox, Edge, Safari).
  • API Integrations: Well-documented API for programmatic access and extension.
  • Responsiveness: Adaptable UI/UX for desktop, tablet, and mobile devices.

1.3. Aesthetic Requirements

  • Modern & Clean Design: A contemporary, uncluttered interface that prioritizes data clarity.
  • Professionalism: A sophisticated and reliable visual identity that inspires trust.
  • Customization: Future potential for white-labeling and theme customization.
  • Data-Ink Ratio: Emphasis on maximizing the data-ink ratio, minimizing chart junk.

2. Wireframe Descriptions

The following outlines the structure and key components of essential screens within the Data Visualization Suite. These descriptions will guide the creation of low-fidelity wireframes in the next phase.

2.1. Login / Authentication Screen

  • Layout: Centered form with brand logo and suite name.
  • Elements:

* Username/Email input field.

* Password input field (with toggle to show/hide password).

* "Remember Me" checkbox.

* "Forgot Password?" link.

* "Login" button.

* Option for "Register" or "Sign Up" (if self-registration is enabled).

* Potential for SSO/OAuth login buttons (e.g., Google, Microsoft).

2.2. Dashboard Overview Screen

  • Layout: Main content area with a left-hand navigation sidebar.
  • Elements:

* Sidebar: Global navigation (Home, Dashboards, Data Sources, Users, Settings).

* Header: Suite logo, user profile/settings, "Create New Dashboard" button.

* Main Content:

* Search bar for dashboards.

* Filter/Sort options (e.g., by owner, date, tags).

* Grid or list view of existing dashboards. Each card/row displays:

* Dashboard title.

* Thumbnail preview.

* Owner/Last Modified date.

* Action menu (Edit, Share, Duplicate, Delete).

2.3. Data Source Connection Screen

  • Layout: Step-by-step wizard or tabbed interface.
  • Elements:

* Header: "Connect a New Data Source" title.

* Step 1: Choose Source Type: List of supported data sources (icons and names).

* Step 2: Connection Details (dynamic based on source type):

* CSV Upload: File upload area.

* SQL DB: Host, Port, Database Name, Username, Password.

* API: Endpoint URL, Authentication method (API Key, OAuth).

* Step 3: Data Preview & Configuration:

* Table preview of initial data rows.

* Options for column renaming, data type inference/correction.

* "Test Connection" button.

* "Save Data Source" button.

2.4. Data Preparation / Transformation Screen

  • Layout: Split view with data table on top and transformation steps/options below.
  • Elements:

* Header: Data source name, "Save & Prepare Data" button.

* Data Table View:

* Interactive table displaying data.

* Column headers with options for sorting, filtering, changing data types, renaming.

* Context menu on columns for specific transformations (e.g., split column, extract part).

* Transformation Panel:

* List of applied transformation steps (editable/reorderable).

* Toolbox of transformation functions (e.g., Filter, Aggregate, Join, Calculated Field).

* Input fields for defining specific transformations.

* Data Profile/Quality Metrics: (Optional) Summary statistics, missing value counts.

2.5. Visualization Builder Screen

  • Layout: Three-panel layout (left: data fields, center: canvas, right: chart properties).
  • Elements:

* Header: Chart title, "Save Chart" button, "Back to Dashboard" button.

* Left Panel (Data Fields):

* List of available dimensions (categorical data).

* List of available measures (numerical data).

* Search/filter for fields.

* Option to create new calculated fields.

* Center Canvas:

* Drag-and-drop area for dropping fields onto shelves (e.g., "X-Axis", "Y-Axis", "Color", "Size").

* Real-time preview of the visualization as fields are added/modified.

* Right Panel (Chart Properties):

* Chart Type Selector: Dropdown or icon grid to choose chart type.

* Axis Settings: Labels, ranges, tick marks.

* Color & Legend: Color palette selection, legend position.

* Filters: Add specific filters to the current visualization.

* Labels & Tooltips: Customization options.

* Advanced Settings: Sorting, aggregation method.

2.6. Dashboard Builder Screen

  • Layout: Two-panel layout (left: available visualizations, right: dashboard canvas).
  • Elements:

* Header: Dashboard title, "Save Dashboard", "Publish/Share" button, "View Dashboard" button.

* Left Panel (Available Visualizations):

* List of saved charts/visualizations.

* Search/filter for visualizations.

* Drag-and-drop functionality to add to the canvas.

* Right Panel (Dashboard Canvas):

* Grid-based or free-form layout area.

* Visualizations added appear as resizable widgets.

* Context menu on widgets for Edit, Duplicate, Remove.

* Global Dashboard Filters panel (e.g., date range picker, categorical dropdowns).

* Dashboard settings (e.g., theme, background color, refresh interval).


3. Color Palettes

A consistent and accessible color palette is crucial for both UI clarity and effective data storytelling.

3.1. User Interface (UI) Palette

This palette focuses on navigation, text, backgrounds, and interactive elements.

  • Primary Brand Color (Accent): #007BFF (A professional, vibrant blue for primary actions and branding elements.)
  • Secondary Accent Color: #28A745 (A complementary green for success states or secondary calls to action.)
  • Neutral Colors (Backgrounds & Text):

* #FFFFFF (Pure White - for main content backgrounds)

* #F8F9FA (Light Gray - for secondary backgrounds, panels)

* #E9ECEF (Border/Divider Gray - for subtle separators)

* #6C757D (Medium Gray - for secondary text, placeholder text)

* #343A40 (Dark Gray - for primary text, headings)

  • Feedback Colors:

* #DC3545 (Error/Danger - for critical alerts, delete actions)

* #FFC107 (Warning - for cautionary messages)

* #17A2B8 (Info - for informational messages)

3.2. Data Visualization Palettes

These palettes are designed for optimal readability and impact when presenting data, considering accessibility.

  • Categorical Palette (for distinct categories):

* #4285F4 (Blue)

* #EA4335 (Red)

* #34A853 (Green)

* #FBBC05 (Yellow/Orange)

* #9C27B0 (Purple)

* #00BCD4 (Cyan)

* #FF5722 (Deep Orange)

* #607D8B (Slate Gray)

Recommendation:* Ensure sufficient contrast between adjacent colors. Offer a "colorblind-friendly" option.

  • Sequential Palette (for continuous data, low to high):

* Light to Dark Blue: #E3F2FD#BBDEFB#90CAF9#64B5F6#42A5F5#2196F3#1976D2#1565C0#0D47A1

Recommendation:* Allow users to select different sequential gradients (e.g., green, purple, grayscale).

  • Diverging Palette (for data with a meaningful midpoint, e.g., positive/negative):

* Red-White-Blue: #DC3545 (Strong Negative) → #F8D7DA (Mild Negative) → `#FFFFFF

gemini Output

Data Visualization Suite: Finalized Design Assets & UX Specifications

Date: October 26, 2023

Project: Data Visualization Suite

Deliverable: Finalized Design Assets & UX Specifications (Step 3 of 3: gemini → finalize_design_assets)


1. Introduction

This document outlines the comprehensive and detailed design specifications for the Data Visualization Suite. It serves as the final design blueprint, encompassing visual aesthetics, structural layouts, user interaction principles, and accessibility considerations. Our aim is to deliver a professional, intuitive, and highly effective platform that empowers users to explore, understand, and act upon their data with clarity and efficiency.

This deliverable will guide the development team in implementing the user interface (UI) and user experience (UX) to meet the highest standards of usability and visual appeal.


2. Overall Design Philosophy

The design philosophy for the Data Visualization Suite is centered around Clarity, Efficiency, and Professionalism.

  • Clarity: Data should be presented in an unambiguous and easy-to-understand manner. Visualizations will be clean, free from clutter, and prioritize the data story.
  • Efficiency: Users should be able to navigate, filter, and interact with data quickly and intuitively. The interface minimizes cognitive load and maximizes productivity.
  • Professionalism: The suite will exude a modern, sophisticated, and trustworthy aesthetic, aligning with enterprise-grade applications. It will be consistent in its visual language and responsive across devices.

3. Core Components & Wireframe Descriptions

The suite is designed around a modular dashboard concept, allowing for flexibility and scalability.

3.1. Master Layout & Navigation

  • Header Bar (Fixed Top):

* Left: Application Logo (e.g., "PantheraHive Data Suite").

* Center/Right: Global Search Bar, User Profile/Settings (Avatar, dropdown menu for "My Profile," "Settings," "Logout"), Notifications Icon.

* Description: Provides consistent branding, global search functionality, and essential user controls. Always visible for quick access.

  • Sidebar Navigation (Fixed Left):

* Collapsible: Icon-based navigation with text labels appearing on hover/expansion.

* Content:

* Dashboard Overview (Home)

* Data Sources

* Reports & Analysis

* Custom Dashboards

* Admin Panel (if applicable, for authorized users)

* Help & Support

* Description: Primary navigation for switching between major sections of the application. The collapsible nature maximizes screen real estate for data content.

  • Main Content Area:

* Description: The primary canvas for dashboards, reports, and data tables. Utilizes a responsive grid system for flexible arrangement of visualization widgets.

3.2. Dashboard View

  • Dashboard Header:

* Left: Dashboard Title (H1), Description (P-small).

* Right: Action buttons (e.g., "Add Widget," "Share," "Export," "Edit Layout," "Refresh Data").

* Description: Clearly identifies the current dashboard and provides key actions related to its management.

  • Filter/Control Panel (Top or Left-aligned within Main Content):

* Description: A dedicated area for global filters (e.g., Date Range Picker, Region Selector, Department Filter). Filters should be clearly labeled and provide immediate feedback on selected values. Can be collapsible or a dedicated row.

  • Visualization Widgets/Cards:

* Structure: Each visualization (chart, graph, KPI card, table) is contained within a distinct card.

* Header: Widget Title (H3), Context Menu (ellipsis icon for "View Details," "Export Data," "Remove Widget," "Duplicate Widget").

* Body: The visualization itself.

* Footer (Optional): Last updated timestamp, source data link.

* Description: Self-contained, draggable, and resizable units of data insight. Standardized card design ensures consistency.

3.3. Data Table View (for detailed data exploration)

  • Table Header: Table Title, Search Bar specific to table data, Column Visibility Toggle, Export (CSV/Excel) button.
  • Table Body:

* Column Headers: Sortable, Filterable (via dropdowns/text input).

* Rows: Alternating row colors for readability. Hover states for individual rows.

* Pagination: Bottom of the table for navigating large datasets.

  • Description: Provides a clear, organized, and interactive view of underlying tabular data, complementing visual summaries.

4. Detailed Design Specifications

4.1. Typography

  • Primary Font Family: Inter (or similar modern sans-serif like Open Sans, Roboto)

* Rationale: Highly legible, clean, and professional for both headings and body text, with a good range of weights.

  • Font Weights: Regular (400), Medium (500), Semi-bold (600), Bold (700)

| Element | Font Family | Weight | Size (px) | Line Height | Color (Hex) | Usage Example |

| :------------------ | :---------- | :------- | :-------- | :---------- | :------------- | :---------------------------------------------- |

| Application Title | Inter | Bold | 24 | 32 | #2C3E50 | "PantheraHive Data Suite" |

| Dashboard Title | Inter | Semi-bold | 20 | 28 | #2C3E50 | "Sales Performance Overview" |

| Widget Title | Inter | Medium | 16 | 24 | #34495E | "Revenue by Region" |

| Body Text | Inter | Regular | 14 | 22 | #5E6D82 | "This dashboard provides a comprehensive..." |

| Labels/Captions | Inter | Regular | 12 | 18 | #8A9BAA | "Last Updated: 2023-10-26" |

| Data Values (Large KPI) | Inter | Bold | 36 | 48 | #2C3E50 | "$1.2M" |

| Navigation Items | Inter | Medium | 14 | 20 | #34495E (active) | "Dashboards" |

4.2. Iconography

  • Style: Line-based, consistent stroke weight, filled icons for active states.
  • Library: Utilize a professional icon library such as Font Awesome Pro, Material Design Icons, or Feather Icons for consistency and scalability.
  • Usage:

* Navigation items (e.g., home, chart, settings).

* Action buttons (e.g., add, edit, share, export).

* Status indicators (e.g., success, warning, error).

* Interactive elements (e.g., info tooltips, collapse/expand).

4.3. Spacing & Grid System

  • Base Unit: 8px. All spacing (margins, paddings, gaps) will be multiples of 8px (e.g., 8px, 16px, 24px, 32px).
  • Layout Grid:

* Dashboard: 12-column flexible grid system for main content area.

* Widget Spacing: 24px gap between visualization widgets.

* Internal Widget Padding: 24px padding within each widget card.

  • Rationale: Ensures visual harmony, consistency, and efficient use of space across the application.

4.4. Responsiveness

  • Breakpoints:

* Small (Mobile): <768px (e.g., single column layout for widgets)

* Medium (Tablet): 768px - 1200px (e.g., 2-column layout)

* Large (Desktop): >1200px (e.g., 3-4 column layout)

  • Adaptation:

* Sidebar navigation collapses into a hamburger menu on smaller screens.

* Visualization widgets resize and reflow to fit available screen width.

* Data tables adapt by either horizontal scrolling or progressive disclosure of columns.

  • Rationale: Ensures optimal user experience across various devices and screen sizes.

4.5. Accessibility

  • Color Contrast: All text and interactive elements will meet WCAG 2.1 AA contrast ratio standards (minimum 4.5:1 for small text, 3:1 for large text).
  • Keyboard Navigation: All interactive elements (buttons, links, form fields, navigation) will be fully navigable and operable via keyboard. Clear focus states will be provided.
  • ARIA Labels: Appropriate ARIA attributes will be used to enhance screen reader compatibility for complex components (e.g., charts, interactive tables).
  • Scalable Text: Text will be resizable without loss of content or functionality.
  • Alternative Text: Image-based elements (e.g., icons not purely decorative) will have descriptive alt text.

5. Color Palettes

The color palettes are designed for clarity, brand consistency, and effective data differentiation.

5.1. Primary UI Palette

  • Primary Blue: #3498DB

Usage:* Interactive elements (buttons, links, active states), primary accents.

  • Dark Blue (Text/Headings): #2C3E50

Usage:* Main text, primary headings, application title.

  • Medium Gray (Sub-text/Borders): #5E6D82

Usage:* Secondary text, placeholder text, borders, inactive states.

  • Light Gray (Backgrounds): #F8F9FA

Usage:* Application background, card backgrounds.

  • Border Gray: #E0E6ED

Usage:* Separators, subtle borders.

  • White: #FFFFFF

Usage:* Card backgrounds, modal backgrounds, primary content areas.

5.2. Data Visualization Palettes

These palettes are carefully selected to ensure distinctness, readability, and to convey meaning effectively, adhering to colorblind-friendly principles where possible.

  • Categorical Palette (for distinct categories):

* #3498DB (Blue)

* #2ECC71 (Green)

* #F1C40F (Yellow)

* #E74C3C (Red)

* #9B59B6 (Purple)

* #1ABC9C (Turquoise)

* #E67E22 (Orange)

* #A9B0B8 (Light Gray - for "Other" or less significant categories)

Usage:* Bar charts, pie charts, line charts with multiple series, scatter plots.

  • Sequential Palette (for ordered data, e.g., low to high):

Example (Greens):* #D4EDDA (Light) -> #2ECC71 (Medium) -> #1B6A3B (Dark)

Example (Blues):* #EAF4F9 (Light) -> #3498DB (Medium) -> #1F5E8E (Dark)

Usage:* Heatmaps, choropleth maps, intensity scales.

  • Diverging Palette (for data with a critical midpoint, e.g., positive/negative):

Example:* #E74C3C (Red - Negative) -> #F8F9FA (Neutral) -> #2ECC71 (Green - Positive)

Usage:* Sentiment analysis, performance against target, deviation charts.

5.3. Semantic Colors

  • Success: #2ECC71 (Green)

Usage:* Positive actions, completion, successful operations.

  • Warning: #F1C40F (Yellow/Orange)

Usage:* Alerts, cautionary messages, pending states.

  • Error: #E74C3C (Red)

Usage:* Negative feedback, critical alerts, failed operations.

  • Info: #3498DB (Blue)

Usage:* Informational messages, tips.


6. User Experience (UX) Recommendations

6.1. Interactivity & Exploration

  • Filtering:

* Global filters at the dashboard level, widget-specific filters within cards.

* Clear visual indication of applied filters.

* Ability to save filter presets for recurring analysis.

  • Drill-Down Capabilities:

* Clicking on a data point (e.g., a bar in a bar chart) should allow users to drill down to more granular data or related reports.

* Breadcrumbs should appear to indicate drill-down path.

  • Tooltips:

* Contextual tooltips on hover over data points in visualizations, providing detailed values and dimensions.

* Tooltips should be informative but concise.

  • Zoom & Pan:

* For complex charts (e.g., time series with many data points), provide zoom and pan functionality.

  • Cross-Filtering:

* Selecting data in one widget should optionally filter or highlight related data in other widgets on the same dashboard.

6.2. Information Hierarchy & Readability

  • Clear Headings: Use distinct typography for titles and subtitles to establish a clear hierarchy.
  • Visual Grouping: Use card containers, background colors, and spacing to visually group related information.
  • Consistent Legend Placement: Legends for charts should be consistently placed (e.g., top-right or bottom-center) and clearly associated with their respective visualizations.
  • Minimalist Design: Avoid unnecessary chart junk, gradients, or excessive shadows that can distract from the data.

6.3. Feedback Mechanisms

  • Loading States: Provide clear visual feedback (spinners, skeleton loaders) when data is being fetched or visualizations are rendering.
  • Error Messages: Informative and actionable error messages for data loading failures, invalid inputs, or system issues.
  • Success Notifications: Brief, non-intrusive notifications for successful actions (e.g., "Dashboard saved successfully").
  • Empty States: Design engaging and helpful empty states for dashboards or widgets with no data, guiding users on how to populate them.

6.4. Customization & Personalization

  • Dashboard Layout Customization: Allow users to drag, drop, resize, and add/remove widgets to create personalized dashboards.
  • Theming (Optional): Consider a light/dark mode toggle based on user preference or system settings.
  • Report Scheduling: Enable users to schedule reports for automated delivery to themselves or team members.

6.5. Onboarding & Help

  • Interactive Tours: Short, guided tours for first-time users to introduce key features and functionalities.

*

data_visualization_suite.md
Download as Markdown
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}