# diagram-script

> 

**Framework:** angular  **Component:** diagram  **Variant:** script

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/angular/diagram-script.json
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/diagram-script/diagram-common.ts

```typescript
/**
 * script for mobile symbol-palette
 */

let isMobile: boolean;

export function paletteIconClick() {
    isMobile = window.matchMedia('(max-width:550px)').matches;
    if (isMobile) {
        let paletteIcon: HTMLElement = document.getElementById('palette-icon')!;
        if (paletteIcon) {
            paletteIcon.addEventListener('click', showPaletteIcon, false);
        }
    }
}

export function showPaletteIcon(): void {
    let paletteSpace: HTMLElement = document.getElementById('palette-space')!;
    isMobile = window.matchMedia('(max-width:550px)').matches;
    if (isMobile) {
        if (!paletteSpace.classList.contains('sb-mobile-palette-open')) {
            paletteSpace.classList.add('sb-mobile-palette-open');
        } else {
            paletteSpace.classList.remove('sb-mobile-palette-open');
        }
    }
}

```
