Giter Site home page Giter Site logo

tumoiyorozu / svg_visualizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shindannin/p5visualizer

1.0 0.0 0.0 1.15 MB

競プロ用。C++コードに描画コマンドを埋め込み、ファイルを出力し、それをブラウザ上で表示させる

JavaScript 51.65% C++ 22.95% CSS 6.94% HTML 6.29% Python 12.17%

svg_visualizer's Introduction

p5visualizer

競プロ用。C++コードに描画コマンドを埋め込み、ファイルを出力し、それをブラウザ上で表示させる

特徴

提出コードに、描画コマンドが埋め込めるので、簡単!

  • スコア判定などをビジュアライザ用と提出コード用2回書かずに済む。
  • 提出コードの一時変数を表示させたいときに、直接描画できるので便利。
  • TODO
  • p5.jsに準拠しているので、それなりに機能も豊富。

コードの例

  • TODO image

ビジュアライズの例

  • TODO image

使用方法

  1. 自分のコードに、macro.cppを挿入する。
  2. 描画コマンドを書いていく。
  3. 自分のコードを実行すると、ファイルVisCommands.txtが出力される。
  4. ビジュアライザindex.htmlをブラウザで開く。
  • TODO
  1. 「ファイル」で先ほど出力されたVisCommands.txtを開く。
  2. 表示される。時間のスライダーで表示させたい時間を選べる。

※自分のコードを提出するときは、#define VISUALIZE をコメントアウトしてください。

描画命令一覧

時間命令

p5.jsにないオリジナルの命令です。ここで指定した時間は再変更するまで全ての描画で使用される。

  • time(t) スライダーで時間指定したときに表示される時間を指定する。

基本図形

  • TODO

描画スタイルや属性の一時退避

  • push()
  • pop()

テキスト描画

  • textAlign(alignX, alignY="")
  • textLeading(leading)
  • textSize(size)
  • textStyle(style)
  • textWidth(text)
  • textAscent()
  • textDescent()
  • textWrap(wrap)
  • text(str, x, y)
  • textFont(fontName)

サンプル

TODO

  • 時間の範囲指定(追加しようか迷う…)
  • 入力・出力などテキストを表示させるためのテキストボックス
  • push, popなど名前の衝突が起きそうだけど使えそうな関数をどうするか?
  • 3D描画

svg_visualizer's People

Contributors

shindannin avatar tumoiyorozu avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.