Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tkar

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tkar

  • 0.65
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Tkar -- Tk-based animation process and protocol

The Tkar animator aims to do one thing well: listen to an incoming stream of data and animate it in a 2D canvas. User interaction is streamed back out.

Additional documentation:

  • protocol
  • FAQ

Overview

Tkar is a Tk/ruby-based animation program using TkCanvas. It accepts command input from stdin or a socket. Commands may define parametrized shapes, place them on the canvas, move and rotate them, change parameters, etc. User interaction events (click, drag, etc) are sent back on the socket or stdout. The canvas can be resized, scrolled, zoomed, and tracked to an object.

Graphical constructs

  • Shapes include: arc, oval, polygon, line, curve, text, bitmap.

  • Parameters include color/pattern of border/area, arrowheads, splines, line dot/dash/width, text font, etc.

  • Can group, layer, rotate, move, and scale objects

Tkar command summary

commandeffect
shapedefine shape in terms of primitives (Tk Canvas objects). Shape may expose any Tk parameters (e.g, colors, lengths of poly sides)
addadd object to canvas with specified shape, layer, position, rotation, params
move, rotate, scale, deleteoperate on existing object
paramchange param value of an object (e.g. change color or geometry over time; change arrow shape because endpoint moves)
waitplayback with specified frame rate
updatefinish time step
paramsset window params (color, size, zoom)
followfollow a specified object
loadload file (like #include)

User interaction

  • Use keys and mouse to zoom, pan/scroll, select, double-click, drag, drop, etc.

  • User commands are sent back over stream to controlling process, e.g. "drag 2 140.0 259.0" and "drop 2 7" ("2" and "7" are object ids)

Installation

Prerequisites

Tcl/Tk

For windows: http://www.activestate.com/Products/ActiveTcl/

For linux, just use your distribution's package tool to install tcl. However, you may need to make sure that ruby and linux both use (or do not use) the pthread library.

Ruby

For windows: http://rubyforge.org/projects/rubyinstaller/

For other platforms: http://www.ruby-lang.org

Gem installation

  gem install tkar

Alternately, you can download the source code (tar ball or git repo) and run it in place using the --local-lib command line option

  bin/tkar --local-lib

Usage

Command line

See the -h command line option for details on running tkar.

Examples are available with the source code--read the comments to see how to run.

Tkar window

Press the "h" key for on-line help using the tkar window.

Protocol

See protocol for details on the protocol and writing shape files.

Integrating tkar with other applications

There are three transport options:

  1. Over pipe

Invoke as

  cat data | tkar

or

  program | tkar
  • unidirectional (no mouseclick feedback to program)

  • output messages simply go to stdout

  • easy to write filters this way

  1. Over TCP socket

Invoke as

  tkar [<ipaddr>] <port>
  • bidirectional; client can block waiting for update to finish

  • remote host possible, using ipaddr=="localhost"

  • if port is 0, lets OS choose port and prints it to stderr

  • can still write filters by using netcat

  1. Over unix domain socket

Invoke as

  tkar /path/to/socket
  • bidirectional; client can block waiting for update to finish

  • faster than TCP (but unix/linux only)

Note that tkar has a -c option which tells it to be the socket client rather than the server. This is useful when your main program needs to choose the port, for example.

Tkar can be interfaced with Simulink. Tkar appears in a simulink model as a block to which can be wired to any number of data sources that drive objects in the animation. You can have several tkar blocks. Think of tkar as the animation version of the built-in plotting block. (Simulink's built-in animation capabilities are bad.)

An additional set of C files need to be compiled as a Simulink extension. Contact author for details.

Author

Copyright 2006-2014, Joel VanderWerf, mailto:vjoel@users.sourceforge.org

License

License is BSD. See COPYING.

FAQs

Package last updated on 09 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc