본문으로 건너뛰기
cccskills
무료GitHub에 공개

add-info-panel

Create info panels that appear in the context panel based on semantic types

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Add an Info Panel

Help the user create info panels that display context-specific information in Datagrok's context panel.

Usage

/add-info-panel [panel-name] [--semtype <semantic-type>] [--input-type <string|column|dataframe|file>]

Instructions

1. Understand info panels

Info panels appear in the context panel on the right side of the Datagrok UI. They show additional information about the currently selected object (cell value, column, table, file). Panels are re-evaluated whenever the selected object changes.

2. Create a panel function in src/package.ts

A panel function must be annotated with panel tag and return a widget:

//name: MyPanel
//tags: panel, widgets
//input: string str {semType: Molecule}
//output: widget result
export function myPanel(str: string) {
  return new DG.Widget(ui.divV([
    ui.divText('Info about: ' + str)
  ]));
}

Key annotations:

  • //tags: panel, widgets -- marks this as a panel function returning a widget
  • //input: -- defines what object triggers the panel
  • //output: widget result -- panels must output a widget
  • {semType: <type>} on the input -- restricts panel to columns with this semantic type

3. Input types

Panels accept a single input parameter of various types:

// For cell values (filtered by semantic type)
//input: string str {semType: text}

// For columns
//input: column col

// For dataframes
//input: dataframe table

// For files
//input: file file

// For semantic values (preserves cell context)
//input: semantic_value smiles {semType: Molecule}

Using semantic_value gives access to the cell's column and row context:

//input: semantic_value smiles {semType: Molecule}
//output: widget result
export function valueWidget(value) {
  return value
    ? new DG.Widget(ui.divText('Column: ' + value.cell.column.name))
    : new DG.Widget(ui.divText('No value'));
}

4. Visibility conditions

Control when panels appear using the //condition: annotation:

By semantic type (most common -- use semType on the input parameter):

//input: string str {semType: Molecule}

By column properties:

//input: column x
//condition: x.isnumerical && x.name == "f3" && x.stats.missingvaluecount > 0

By dataset:

//condition: table.gettag("database") == "northwind"

By user role:

//condition: user.hasrole("chemist")

By column semantic type in condition:

//condition: columnName.semType == "Molecule"

Custom function condition:

//condition: isTextFile(file)

Conditions use Grok Script syntax regardless of the panel's implementation language.

5. Panel scripts (server-side)

Panels can also be written as scripts in Python, R, etc. These execute on the server:

# name: string length
# language: python
# tags: panel
# input: string s {semType: text}
# output: int length
# condition: true

length = len(s)

6. Panels with viewers

Return interactive visualizations in a panel:

//name: ScatterPanel
//tags: panel, widgets
//input: dataframe table
//condition: table.columns.containsAll(["height", "weight"])
//output: widget result
export function scatterPanel(table: DG.DataFrame) {
  const viewer = DG.Viewer.scatterPlot(table, {x: 'height', y: 'weight'});
  return new DG.Widget(viewer.root);
}

7. Build and test

npm run build
grok publish dev

To test: open a dataset, click on a cell in a column with the matching semantic type, and check the context panel on the right for your panel.

To manually set a column's semantic type for testing: right-click the column header, select Column Properties, add the tag quality: <semType>.

Behavior

  • Ask for the panel name and what data it should display if not specified.
  • Always ask what semantic type or condition should trigger the panel.
  • Default to TypeScript panel functions (client-side) unless the user needs server-side computation.
  • Use DG.Widget as the return wrapper -- the panel output must be a widget.
  • Suggest semantic_value input type when the user needs access to cell/column context.
  • Remind the user that semantic type detectors can be defined in detectors.js to auto-detect custom types.
  • Follow Datagrok coding conventions: no excessive comments, no curly brackets for one-line if/for, catch/else-if on new line.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Add support for a new curve data format in the Curves package converter system

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Add a new single-objective optimization algorithm to the sci-comp library. Use when the user asks to implement a new optimizer (e.g. gradient descent, BFGS, simulated annealing, differential evolution).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Add unit tests to a Datagrok package

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Answer a "how do I …" question about the platform with a Gherkin scenario on @datagrok-libraries/bdd that is filmed into a how-to video (grok-bdd guide), so the answer is demonstrated, sent as a video plus numbered steps, and kept as a regression test; the same scenarios, filmed in help mode, are the GIFs of the help pages

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

Translate hand-written Playwright specs (or any existing UI tests) into Gherkin features on @datagrok-libraries/bdd, then prove the features test what they claim by backward-matching them against the originals with independent reviewers, and fix the gaps in the core, the library and the features

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

build-app

무료

Create a Datagrok application with routing, views, and data access

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datagrok-ai/public742026년 10월 20일 업데이트

datagrok-ai의 스킬 모두 보기

이 스킬의 문제 신고