Skip to content

remove

remove удаляет сущности по id.

ts
timeline.value?.remove({
  tasks: ['task-1'],
  groups: ['group-old'],
  backgrounds: ['window-1'],
})
Исполняемый примерTimeline: API updatesBatch update и retained frame.
import { Nova, NovaNode, type NovaSchema } from '@endge/nova'

// Документационный сценарий: timeline-chart-api-updates
class ExampleNode extends NovaNode<Record<string, Event>> {
  render(): void {
    const schema: NovaSchema = [
      {
        type: 'rect',
        x: 24,
        y: 24,
        width: this.width - 48,
        height: this.height - 48,
        styles: { background: '#0d2745' },
      },
      {
        type: 'text',
        x: 44,
        y: 44,
        width: this.width - 88,
        height: 32,
        text: 'Timeline: API updates',
        styles: { color: '#e8f5ff' },
      },
    ]

    this.renderer.schema(schema)
    this.setRenderBoundsFromSchema(schema)
  }
}

export function mountExample(canvas: HTMLCanvasElement) {
  const app = Nova.createApp({
    target: canvas,
    size: { width: canvas.clientWidth, height: canvas.clientHeight, maxDpr: 2 },
    scheduler: { loop: false },
  })
  const surface = app.surface({ id: 'render-pipeline' })
  surface.createNode(ExampleNode)

  return () => app.destroy()
}

После удаления группы

Не оставляйте задачи с устаревшим groupId, если они должны исчезнуть вместе с группой. Удаляйте их той же операцией или заранее переносите в groupId: null.