yzsp-studio/mediakit-shared-suite / ppt
ppt
Unverified飞书幻灯片:创建和编辑幻灯片。创建演示文稿、读取幻灯片内容、管理幻灯片页面(创建、删除、读取、局部替换)。当用户需要创建或编辑幻灯片、读取或修改单个页面时使用。
scripts/svg_relation_lib/attributes/confidence.py
View on GitHub"""
A9 · Confidence attribute · certainty in [0, 1]
字段:confidence (float 0-1)
默认视觉通道:dash_pattern (低 confidence → 虚线)
备用通道:opacity
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple
@dataclass
class Confidence:
"""Confidence attribute · 边/节点的确信度。"""
field_name: str = "confidence"
v1_aliases: Tuple[str, ...] = ("certainty", "prob", "probability")
channel: str = "dash_pattern"
fallback_channel: str = "opacity"
def resolve_value(self, element: dict) -> Optional[float]:
for name in (self.field_name,) + tuple(self.v1_aliases):
if name in element and element[name] is not None:
try:
v = float(element[name])
return max(0.0, min(1.0, v))
except (TypeError, ValueError):
return None
return None
def encode(self, value: float, channel: str, palette=None) -> dict:
v = max(0.0, min(1.0, value))
if channel == "dash_pattern":
if v >= 0.85:
return {"stroke-dasharray": None}
if v >= 0.6:
return {"stroke-dasharray": "8 3"}
if v >= 0.3:
return {"stroke-dasharray": "4 3"}
return {"stroke-dasharray": "2 4"}
if channel == "opacity":
return {"opacity": max(0.2, min(1.0, 0.25 + v * 0.75))}
return {}
DEFAULT_CONFIDENCE = Confidence()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |