lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Is there any method available to plot interactive graphs using this method? For example if we have millions of items in a graph, it will be difficult to present in a single screen. In that case, we will represent items as very small items, and will give the user more option to zoom the graph. Like this, is it possible to draw an interactive graph?

Thanks,
  Lloyd


On Wed, 12 Aug 2009 11:43:23 +0530, Asko Kauppi <askok@dnainternet.net> wrote:


I'll be doing some SVG graphics work and applied some Lumikki-kind thinking to making a simple SVG generation tool, in Lua.

Currently available only by svn checkout, from:

	svn co svn://slugak.dyndns.org/public/2009/Svg

Here's one of the sample files:

--
-- ELLIPSE1.LUA
--

require "svgcore"

local rgb= assert(svg.rgb)

print( svg.document(
     svg.default{ stroke_dasharray={2,2},
         --
         svg.ellipse{ {80,110}, {75,105}, fill="#538" },
svg.ellipse{ {80,110}, {60,40}, fill="black", stroke="red", stroke_width=25 }, svg.ellipse{ {80,110}, {35,20}, fill="#538", stroke="yellow", stroke_width=25 }, svg.ellipse{ {80,50}, {40,30}, fill="red", stroke="black", stroke_width=25 }, svg.ellipse{ {80,50}, {30,20}, fill="orange", stroke="red", stroke_width=10 }, svg.ellipse{ {80,170}, {40,30}, fill="yellow", stroke="orange", stroke_width=25 }, svg.ellipse{ {80,170}, {30,20}, fill="red", stroke="black", stroke_width=10 }
     }
) )

The idea is that Lua syntax is a bit nicer to craft than XML, but this also allows programmatic creation of macro-like objects (functions that create graphical objects) that can be turned around, copied etc.. SVG has a "uses" element for that, but this is more easy on the eyes (clearer code).

I post this mostly to inform if anyone has a similar need. Be my guest and use it. Haven't decided the license yet.

Btw, SVG + JavaScript is a perfect blend for making visually good- looking UI applications. SVG in theory support any scripting language, so maybe we can at one day have SVG+Lua viewer.

-asko




______________________________________
Scanned and protected by Email scanner