算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
install-putior【设计与创意】Install and configure the putior R package for workflow visualization. Covers CRAN and GitHub installation, optional dependencies (mcptools, ellmer, shiny, shinyAce, logger, plumber2), and verification of the complete annotation-to-diagram pipeline. Use when setting up putior for the first time, preparing a machine for workflow visualization tasks, w…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
裝 putior R 包及其可選依賴使注解至圖之管線可用。
mcptools、ellmer)、交互(shiny、shinyAce)、日志(logger)、ACP(plumber2)確 R 可得且合最低版需。
R.Version()$version.string
# Must be >= 4.1.0
# From WSL with Windows R
"/mnt/c/Program Files/R/R-4.5.2/bin/Rscript.exe" -e "cat(R.version.string)"
得: R 版串已印,>= 4.1.0。
敗則: 裝或升 R。Windows 者自 https://cran.r-project.org/bin/windows/base/ 下。Linux 用 sudo apt install r-base。
自 CRAN(穩)或 GitHub(開發)裝。
# CRAN (recommended)
install.packages("putior")
# GitHub dev version (if latest features needed)
remotes::install_github("pjt222/putior")
得: 包無誤裝。library(putior) 默載。
敗則: 若 CRAN 裝敗報「此 R 版無」,用 GitHub 版。若 GitHub 敗,察 remotes 已裝:install.packages("remotes")。
依所需功能裝可選包。
# MCP server integration (for AI assistant access)
remotes::install_github("posit-dev/mcptools")
install.packages("ellmer")
# Interactive sandbox
install.packages("shiny")
install.packages("shinyAce")
# Structured logging
install.packages("logger")
# ACP server (agent-to-agent communication)
install.packages("plumber2")
得: 每包無誤裝。
敗則: mcptools 者,確 remotes 先裝。Linux 系統依誤者,裝所需庫(如 httr2 依之 sudo apt install libcurl4-openssl-dev)。
行基本管線以確皆作。
library(putior)
# Check package version
packageVersion("putior")
# Verify core functions are available
stopifnot(
is.function(put),
is.function(put_auto),
is.function(put_diagram),
is.function(put_generate),
is.function(put_merge),
is.function(put_theme)
)
# Test basic pipeline with a temp file
tmp <- tempfile(fileext = ".R")
writeLines("# put id:'test', label:'Hello putior'", tmp)
cat(put_diagram(put(tmp)))
得: Mermaid 流程圖碼印於控制台含 test 與 Hello putior。
要默認:所有掃函(
put()、put_auto()、put_generate()、put_merge())默recursive = TRUE,自動掃子目錄。此為 0.2.0 前版默FALSE之破變。所有掃函亦受exclude參為正則檔過(如put("./src/", exclude = "test_"))。
若可選 shiny 包已裝,試交互沙盒:
putior::run_sandbox()
此啟瀏覽器編輯器,可試 PUT 注解語法並實時見圖渲染。
敗則: 若 put 未找,包未正裝。以 install.packages("putior", dependencies = TRUE) 重裝。若圖空,驗臨檔已創且注解語法用雙引號內單引號。
library(putior) 無誤載packageVersion("putior") 返有效版put() 於含有效 PUT 注解之檔返一行資料框put_diagram() 生始以 flowchart 之 Mermaid 碼id:'name'id:"name"(某語境中與注解串分隔衝).Renviron 設 RSTUDIO_PANDOCrenv::install("putior") 代 install.packages("putior")GITHUB_PAT 自 GitHub 裝 mcptools 或敗usethis::create_github_token() 設之analyze-codebase-workflow — 裝後次步察庫configure-putior-mcp — 裝可選依後設 MCP 伺服器manage-renv-dependencies — 於 renv 環境管 putiorconfigure-mcp-server — 通用 MCP 伺服器配置generate-workflow-diagram — 裝後生工作流圖之下游技能annotate-source-files — 注源檔為前提步驟