Hello all!
I have gotten slightly further in my ambition to make a clim program to draw tree diagrams. After looking at various examples I have put together a little program that gives the error below.
No matching method for the generic function #<STANDARD-GENERIC-FUNCTION CLIM:LAYOUT-GRAPH-NODES (1) {58CD5C11}>, when called with arguments (#<CLIM-INTERNALS::DIGRAPH-GRAPH-OUTPUT-RECORD X 0.0d0:0.0d0 Y 0.0d0:0.0d0 {59D5278D}> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> NIL NIL). [Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
I am loading CLIM with asdf in my .cmucl-init and doing other stuff such as drawing a lines, rectangles works fine... Is it the code or my environment? I am getting seriously frustrated...
Ideas?
Also my clim package 0.9.1 does not seem to have "format-graph-from-root" (singular) only the "format-graph-from-roots" is this because the one root only version is not implemented? Does anyone know?
Thanks beforehand for any help,
/Peter ______________________________________________________________________ draw-tree.cl
(defpackage :tree-test (:USE :CLIM :CLIM-EXTENSIONS :CLIM-LISP))
(in-package :tree-test)
(defvar *test-frame* nil) (defvar *test-pane* nil)
(defun run-tree-test () (let ((*test-frame* (setf *test-frame* (make-application-frame 'tree-test :height 400 :width 700 :doc-title "Tree diagram test")))) (run-frame-top-level *test-frame*) *test-frame*))
(define-application-frame tree-test () ()
(:menu-bar menubar-command-table) (:panes (screen :application :display-time nil :text-style (make-text-style :sans-serif :roman :normal) ) ) (:layouts (defaults (vertically () screen) ) ) #+nil (:top-level (tree-test-frame-top-level)))
(make-command-table 'menubar-command-table :errorp nil :menu '(("Draw Tree" :command com-tree)))
(define-tree-test-command com-tree () (draw-tree))
(defun draw-tree ()
(setq *test-pane* (get-frame-pane *test-frame* 'screen))
(format-graph-from-roots '((a (b (d)) (c (d)))) #'(lambda (x s) (princ (car x) s)) #'cdr :stream *standard-output* :orientation :vertical :merge-duplicates t :duplicate-key #'car))
Note: Have tried both *standard-output* and *test-pane* as :stream
______________________________________________________________________ No matching method for the generic function #<STANDARD-GENERIC-FUNCTION CLIM:LAYOUT-GRAPH-NODES (1) {58CD5C11}>, when called with arguments (#<CLIM-INTERNALS::DIGRAPH-GRAPH-OUTPUT-RECORD X 0.0d0:0.0d0 Y 0.0d0:0.0d0 {59D5278D}> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> NIL NIL). [Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
Restarts: 0: [CONTINUE] Retry call to :FUNCTION. 1: [ABORT] Return to application command loop 2: [ABORT] Abort handling SLIME request. 3: [ABORT] Return to Top-Level.
Backtrace: 0: ("DEFMETHOD NO-APPLICABLE-METHOD (T)" #<#1=unused-arg> #<#1#> #<STANDARD-GENERIC-FUNCTION CLIM:LAYOUT-GRAPH-NODES (1) {58CD5C11}> (#<CLIM-INTERNALS::DIGRAPH-GRAPH-OUTPUT-RECORD X 0.0d0:0.0d0 Y 0.0d0:0.0d0 {59D5278D}> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> NIL NIL)) 1: ((FLET #:CONTINUATION99 (LABELS CLIM-INTERNALS::CONT CLIM:FORMAT-GRAPH-FROM-ROOTS)) #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}>) 2: ((METHOD CLIM:INVOKE-WITH-OUTPUT-RECORDING-OPTIONS NIL (CLIM:OUTPUT-RECORDING-STREAM T T T)) #<#1=unused-arg> #<#1#> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> #<Closure Over Function (FLET #:CONTINUATION99 (LABELS CLIM-INTERNALS::CONT CLIM:FORMAT-GRAPH-FROM-ROOTS)) {59D528C1}> ...) 3: ((METHOD CLIM:INVOKE-WITH-NEW-OUTPUT-RECORD NIL (CLIM:OUTPUT-RECORDING-STREAM T T NULL)) (#() . #(#)) #<unused-arg> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> #<Closure Over Function (LABELS CLIM-INTERNALS::CONT CLIM:FORMAT-GRAPH-FROM-ROOTS) {59D51C09}> ...) 4: (CLIM:FORMAT-GRAPH-FROM-ROOTS ((TREE-TEST::A # #)) #<Function "DEFUN DRAW-TREE" {59BEF231}> #<Function CDR {101CF0C9}> :ORIENTATION ...) 5: ((METHOD CLIM:DEFAULT-FRAME-TOP-LEVEL NIL (CLIM:APPLICATION-FRAME)) (#() . #(# # # # # ...)) #<unused-arg> #TREE-TEST::TREE-TEST {59BF2A5D} NIL) 6: ("LAMBDA (.KEYARGS-START. .VALID-KEYS. G6356)" #<#1=unused-arg> #<#1#> #<TREE-TEST::TREE-TEST {59BF2A5D}> NIL) 7: ((METHOD CLIM:RUN-FRAME-TOP-LEVEL NIL (CLIM:APPLICATION-FRAME)) (#(20) . #()) #<#1=unused-arg> #<TREE-TEST::TREE-TEST {59BF2A5D}> #<#1#>) 8: ((METHOD CLIM:RUN-FRAME-TOP-LEVEL (:AROUND) #1=(CLIM:APPLICATION-FRAME)) (#(16 15) . #(#)) #S(PCL::FAST-METHOD-CALL :FUNCTION #<Function (METHOD CLIM:RUN-FRAME-TOP-LEVEL NIL #1#) {58C4A031}> :PV-CELL (# . #) :NEXT-METHOD-CALL NIL :ARG-INFO (1 . T)) #TREE-TEST::TREE-TEST {59BF2A5D} NIL) 9: (TREE-TEST::RUN-TREE-TEST) 10: (SWANK::EVAL-REGION "(tree-test::run-tree-test) " T) 11: ("DEFSLIMEFUN LISTENER-EVAL") 12: (SWANK::CALL-WITH-BUFFER-SYNTAX #<Closure Over Function "DEFSLIMEFUN LISTENER-EVAL" {59BF2261}>) 13: ("DEFUN EVAL-FOR-EMACS") 14: ((METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK NIL (T T)) #<#1=unused-arg> #<#1#> #<Function SWANK:SWANK-DEBUGGER-HOOK {59F4E871}> #<Closure Over Function "DEFUN EVAL-FOR-EMACS" {59BF2189}>) 15: ("DEFUN HANDLE-REQUEST") 16: ("DEFUN CALL-WITH-CONNECTION") 17: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION {59F36D15}> #<Closure Over Function "DEFUN CALL-WITH-CONNECTION" {59BF1F09}>) 18: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {59F36D15}> #<Function "DEFUN HANDLE-REQUEST" {5A001911}>) 19: (SWANK::HANDLE-REQUEST #<SWANK::CONNECTION {59F36D15}>) 20: (SWANK::PROCESS-AVAILABLE-INPUT #<Stream for descriptor 6> #<Closure Over Function "DEFUN INSTALL-SIGIO-HANDLER" {59BF1EF9}>) 21: ((FLET SWANK::HANDLER SWANK::INSTALL-SIGIO-HANDLER)) 22: (SWANK-BACKEND::SIGIO-HANDLER #<#1=unused-arg> #<#1#> #<#1#>) 23: ("call_into_lisp+#x8C [#x80548DC] /usr/bin/cmucl") 24: ("funcall3+#x29 [#x80546E4] /usr/bin/cmucl") 25: ("interrupt_handle_now+#xEF [#x80503A3] /usr/bin/cmucl") 26: ("NIL+#x80507C4 [#x80507C4] /usr/bin/cmucl") 27: ("__kernel_sigreturn+#x0 [#xFFFFE420] ") 28: (SYSTEM:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL) 29: (LISP::DO-INPUT #<Stream for Standard Input>) 30: (LISP::INPUT-CHARACTER #<Stream for Standard Input> NIL (LISP::*EOF*)) 31: (LISP::SYNONYM-IN #<Synonym Stream to SYSTEM:*STDIN*> NIL (LISP::*EOF*)) 32: (LISP::TWO-WAY-IN #<Two-Way Stream, Input = #<Synonym Stream to SYSTEM:*STDIN*>, Output = #<Synonym Stream to SYSTEM:*STDOUT*>> NIL (LISP::*EOF*)) 33: (LISP::SYNONYM-IN #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (LISP::*EOF*)) 34: (READ-CHAR #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (LISP::*EOF*) NIL) 35: (LISP::READ-PRESERVING-WHITESPACE-INTERNAL #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (:EOF) T) 36: (LISP::READ-PRESERVING-WHITESPACE-INTERNAL #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (:EOF) NIL) 37: (LISP::READ-PRESERVING-WHITESPACE-INTERNAL 4 #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (:EOF) ...)[:EXTERNAL] 38: (LISP::READ-INTERNAL #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (:EOF) NIL) 39: (READ #<Synonym Stream to SWANK::*CURRENT-STANDARD-INPUT*> NIL (:EOF) NIL) 40: (LISP::%TOP-LEVEL) 41: ((LABELS LISP::RESTART-LISP SAVE-LISP))
Peter Braroe peter.braroe@newsmachine.com writes:
I have gotten slightly further in my ambition to make a clim program to draw tree diagrams. After looking at various examples I have put together a little program that gives the error below.
I believe that the more complicated graph layouts (:digraph, maybe :dag?) are currently unimplemented. Try passing :graph-type :tree explicitly to FORMAT-GRAPH-FROM-ROOTS.
Also my clim package 0.9.1 does not seem to have "format-graph-from-root" (singular) only the "format-graph-from-roots" is this because the one root only version is not implemented? Does anyone know?
The singular FORMAT-GRAPH-FROM-ROOT appears not to be in the Clim II specification.
Cheers,
Christophe
"CR" == Christophe Rhodes csr21@cam.ac.uk writes:
CR> Peter Braroe peter.braroe@newsmachine.com writes: >> I have gotten slightly further in my ambition to make a clim program to >> draw tree diagrams. After looking at various examples I have put >> together a little program that gives the error below.
CR> I believe that the more complicated graph layouts (:digraph, maybe CR> :dag?) are currently unimplemented. Try passing :graph-type :tree CR> explicitly to FORMAT-GRAPH-FROM-ROOTS.
Nothing except tree is currently supported.
>> Also my clim package 0.9.1 does not seem to have >> "format-graph-from-root" (singular) only the "format-graph-from-roots" >> is this because the one root only version is not implemented? Does >> anyone know?
CR> The singular FORMAT-GRAPH-FROM-ROOT appears not to be in the Clim II CR> specification.
Since it's so trivial, any reason not to support it, if only for backward compatibility?
R
Peter Braroe peter.braroe@newsmachine.com writes:
I have gotten slightly further in my ambition to make a clim program to draw tree diagrams. After looking at various examples I have put together a little program that gives the error below.
[...]
Also my clim package 0.9.1 does not seem to have
Have you tried the CVS version?
Paolo
Hello!
I got it working with Christophes tip! Thanks!
Now all I need to do is to figure out how to get it to draw in color... does anyone know if that is supported with :ink or some other method?
Thanks!
/Peter
-------------------------------------------------------------------------- Peter A. Braroe NewsMachine
-----Ursprungligt meddelande----- Från: mcclim-devel-bounces@common-lisp.net [mailto:mcclim-devel-bounces@common-lisp.net] För Paolo Amoroso Skickat: den 7 februari 2006 13:17 Till: mcclim Ämne: Re: [mcclim-devel] Problems getting "format-graph-from-roots" towork...
Peter Braroe peter.braroe@newsmachine.com writes:
I have gotten slightly further in my ambition to make a clim program to draw tree diagrams. After looking at various examples I have put together a little program that gives the error below.
[...]
Also my clim package 0.9.1 does not seem to have
Have you tried the CVS version?
Paolo
"PB" == Peter Braroe peter.braroe@newsmachine.com writes:
PB> Hello all! PB> I have gotten slightly further in my ambition to make a clim program to PB> draw tree diagrams. After looking at various examples I have put PB> together a little program that gives the error below.
PB> No matching method for the generic function PB> #<STANDARD-GENERIC-FUNCTION CLIM:LAYOUT-GRAPH-NODES (1) {58CD5C11}>, PB> when PB> called with arguments PB> (#<CLIM-INTERNALS::DIGRAPH-GRAPH-OUTPUT-RECORD X 0.0d0:0.0d0 Y PB> 0.0d0:0.0d0 PB> {59D5278D}> PB> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> NIL NIL). PB> [Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
The problem arises because DIGRAPH layout has not been implemented in McCLIM. Tree layout is all that has been done. Until such a time as this has been fixed, we should probably change format-graph-from-roots to toss an error if it is called with an unsupported layout method.
I see from your example code that you're trying to draw a tree. Give tree as layout method and I believe you'll be ok.
[...snip...]
PB> Also my clim package 0.9.1 does not seem to have PB> "format-graph-from-root" (singular) only the "format-graph-from-roots" PB> is this because the one root only version is not implemented? Does PB> anyone know?
Hm. I know that I reported this earlier. I guess we never got around to fixing it. It's a pretty easy fix of just turning a single root into a list and then calling format-graph-from-roots, IIRC.
R
Hello again!
FIX
It's a pretty easy fix of just turning a single root into a list and then calling format-graph-from-roots,
What is the most elegant lispe method for this? Could one make it a macro? Examples? Or would it be better to fix it in the CLIM as a patch?
ERROR! Well it sure would help a novice like me with an error! Saves a lot of head scratching...
EXAMPLES It's hard to know what is OK to do and what is not OK. Since I am planning to do a lot of tree graphs I expect I will find out what is doable and what is not... When I am done exploring I could make a new tree-test.cl and perhaps it could go into /Examples? Who would I send that too?
Things I would like to do are: - Color coded trees - Scaling (resize of window event re-scales trees) - Hardcopy (to postscript)
And more...
FUN I am pretty new to both LISP and CLIM but am having a lot of fun with it despite the odd frustration here and there. I am using it for some NLP research what is everyone else doing out there with clim?
Thanks,
/Peter
--------------------------------------------------------------------------- Peter A. Braroe VD, NewsMachine Blekingegatan 44 S-116 62 Stockholm Office: +46-(0)8-442 03 31 Mobile: +46-(0)708-750 991
-----Ursprungligt meddelande----- Från: rpgoldman@real-time.com [mailto:rpgoldman@real-time.com] Skickat: den 7 februari 2006 15:14 Till: peter.braroe@newsmachine.com Kopia: mcclim developers' list Ämne: [mcclim-devel] Problems getting "format-graph-from-roots" to work...
"PB" == Peter Braroe peter.braroe@newsmachine.com writes:
PB> Hello all! PB> I have gotten slightly further in my ambition to make a clim program to PB> draw tree diagrams. After looking at various examples I have put PB> together a little program that gives the error below.
PB> No matching method for the generic function PB> #<STANDARD-GENERIC-FUNCTION CLIM:LAYOUT-GRAPH-NODES (1) {58CD5C11}>, PB> when PB> called with arguments PB> (#<CLIM-INTERNALS::DIGRAPH-GRAPH-OUTPUT-RECORD X 0.0d0:0.0d0 Y PB> 0.0d0:0.0d0 PB> {59D5278D}> PB> #<CLIM:APPLICATION-PANE TREE-TEST::SCREEN {59BF5855}> NIL NIL). PB> [Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
The problem arises because DIGRAPH layout has not been implemented in McCLIM. Tree layout is all that has been done. Until such a time as this has been fixed, we should probably change format-graph-from-roots to toss an error if it is called with an unsupported layout method.
I see from your example code that you're trying to draw a tree. Give tree as layout method and I believe you'll be ok.
[...snip...]
PB> Also my clim package 0.9.1 does not seem to have PB> "format-graph-from-root" (singular) only the "format-graph-from-roots" PB> is this because the one root only version is not implemented? Does PB> anyone know?
Hm. I know that I reported this earlier. I guess we never got around to fixing it. It's a pretty easy fix of just turning a single root into a list and then calling format-graph-from-roots, IIRC.
R
Peter Braroe writes:
what is everyone else doing out there with clim?
My main project at the moment (and also the reason I started writing McCLIM) is Gsharp, an interactive editor for music scores.
There is also a long-term project to create an IDE for Lisp. The best approximation so far is the CLIM Desktop, containing Climacs (editor), Closure (browser), Clouseau (inspector), Beirc (IRC client), the CLIM Listener, a CLIM-based rudimentary debugger pane, etc.
I have also written some minor applications like a GF front browser, a calendar program, and more.