[Ipe-discuss] Plot data extraction from PDF

T T t34www at googlemail.com
Mon Dec 28 21:30:09 CET 2009


Oops, I meant this reply to the list.


2009/12/28 Jan Hlavacek <jhlavace at svsu.edu>:
> On Mon, Dec 28, 2009 at 03:49:06PM +0000, T T wrote:
>> (1) Coordinate system: establish the plot coordinate system from two
>> selected marks (if not given use canvas coordinate system)
>
> This will probably not help you with the rest, but my ipeplots ipelet does
> something like this.  Given a selection, it establishes a coordinate system
> from the bounding box of the selection, if there is no selection, it uses the
> canvas coordinate system.  I have a new version written, right now I am in the
> process of writing documentation.  I will attach the ipelet to this file, so
> you can have a look at it.  Hopefully it will be of help.

Thanks for this suggestion. Indeed, using the bounding box of the
selection instead of marks might be a better idea. And thanks for the
code, I will have a look at it. I think that the code from
Goodies/Insert bounding box might be also relevant in this respect.

I've just finished writing my first ipelet. It executes user supplied
Lua chunk, see the code below. It's really simple and meant to help me
to interactively explore Ipe. One problem is that on Windows, writing
to stdout is not captured anywhere. I ended up changing ipe.exe to CLI
subsystem (one bit change in PE header), so I can see the output from
print statements in the console window. Perhaps it would be an idea to
add some simple command interface to Ipe.

Cheers,

Tomek

----------------------------------------------------------------------
-- Lua chunk ipelet
----------------------------------------------------------------------

label = "Lua chunk"

about = [[Run user input string]]

chunk = ''

function run(model)
 local function runButton(self)
   chunk = self:get("chunk")
   --print(chunk)
   local G = _G.getfenv(0)
   G.model = model
   local f, e = _G.loadstring(chunk)
   if not f then
     print(e)
   else
     f, e = _G.pcall(f)
     if not f then print(e) end
   end
   return
 end
 local d = ipeui.Dialog(model.ui, label)
 d:add("chunk", "text", {}, 1, 1, 1, 4)
 d:add("run", "button", {label="&run", action=runButton}, 2, 4)
 d:set("chunk", chunk)
 if not d:execute() then return end
 return
end



More information about the Ipe-discuss mailing list