all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* column view extension
@ 2012-01-16 21:00 ayvango
  2012-01-17  8:50 ` Eric S Fraga
  2012-01-17 19:33 ` Michael Brand
  0 siblings, 2 replies; 3+ messages in thread
From: ayvango @ 2012-01-16 21:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2652 bytes --]

I've found a non-standard use case for org-mode.

There is plenty of spreadsheets engine with common drawback: spreadsheet cells follow original memory cell abstraction that are handy for a computer but is inconvenient for human. Hierarchical structures is more natural  and in some cases may be used much more effective for at almost half of the data models.

I would use a popular wargame Warhammer 40k army list as example. The army list consist of the sections: HQ (headquarters), Elite, Troop, FA (fast attack), HS (heavy support). Every section divides further on squads and their options. Those an hierarchical structure defined. An army list has it limits on choices for points spent on, occupied slots and so on.

Spreadsheets is inconvenient for roster accounting since I doesn't  know the number of squad, persons it incorporates and their wargear in advance. I would rather extend it dynamically. I've tried to write some template in terms of cell-processor but found it too complicated. It have expressed perfectly in terms of  tree-processor (my own name)  though. I defines some kind of attribute grammar as a tree processor.

The file containing referenced army list attached to the post.

Org-mode gives me more powerful instrument than any spreadsheet I've meet. In two strings it can express the structure demands plenty of verbosity to be recorded in any spreadsheet. I've just defined COLUMNS property for an outline and org-mode gather all required information from its subnodes.

This method saves me a lot of time but it may not be used with other hierarchical data models as simply as for the army list. This models may require more complicated  summary types than those provided from ground. Is there any way to incorporate abstract grammar for defining and processing properties. There is already a way to define synthesized attributes as well as  inherited ones. But there is no way to bind them together with a function to calculate output.

Example. Every node has its point point cost. Parent node costs calculated by summing all its subnodes cost. But I'd like to introduce new attribute: node share that represents point weight of the node among its siblings ( 100% * node.cost / parent(node).cost ). Another example. I'd like to separate node own cost from computed subnodes cost sum. That way I escape creating boring virtual parent nodes existing exclusively for summing model cost with costs of it's own wargear.

I'm using org-mode for it convenience  but I don't know much about lisp and can't extend org-mode. I hope someone become interested in creating spreadtree application based on existing properties code.

[-- Attachment #2: BA.org --]
[-- Type: application/octet-stream, Size: 3233 bytes --]

BA Army 2000
* Army
  :PROPERTIES:
  :COLUMNS:  %25ITEM %4Cost{+} %3KP{+} %7Scoring{+} %4Slot{+}
  :END:
** HQ 
*** Mephiston
    :PROPERTIES:
    :Cost:     250
    :KP:       1
    :Slot:     1
    :END:
*** Dante
    :PROPERTIES:
    :Cost:     225
    :Slot:     1
    :KP:       1
    :END:
** Elite
*** Sanguinary priest
    :PROPERTIES:
    :KP:       1
    :Scoring:  0
    :Slot:     1
    :END:
**** priest
***** priest
      :PROPERTIES:
      :Cost:     50
      :END:
***** jump pack
      :PROPERTIES:
      :Cost:     25
      :END:
***** power sword
      :PROPERTIES:
      :Cost:     15
      :END:
***** melta bomb
      :PROPERTIES:
      :Cost:     5
      :END:
**** priest
***** priest
      :PROPERTIES:
      :Cost:     50
      :END:
***** jump pack
      :PROPERTIES:
      :Cost:     25
      :END:
***** power sword
      :PROPERTIES:
      :Cost:     15
      :END:
***** melta bomb
      :PROPERTIES:
      :Cost:     5
      :END:

** Troops
*** Assault space mariners
    :PROPERTIES:
    :KP:       1
    :Scoring:  1
    :Slot:     1
    :END:
**** 10x Assault sm
     :PROPERTIES:
     :Cost:     180
     :END:
**** 2x inferno
     :PROPERTIES:
     :Cost:     30
     :END:
**** Sergeant wargear
***** meltabomb
      :PROPERTIES:
      :Cost:     5
      :END:
***** power weapon
      :PROPERTIES:
      :Cost:     15
      :END:
***** combat shield
      :PROPERTIES:
      :Cost:     5
      :END:
***** Sergeant
      :PROPERTIES:
      :Cost:     10
      :END:
*** Scout squad
    :PROPERTIES:
    :KP:       1
    :Scoring:  1
    :Slot:     1
    :END:
**** scouts x8
     :PROPERTIES:
     :Cost:     104
     :END:
**** missile launcher
     :PROPERTIES:
     :Cost:     10
     :END:
**** Sergeant
     :PROPERTIES:
     :Cost:     10
     :END:
*** Scout squad
    :PROPERTIES:
    :KP:       1
    :Scoring:  1
    :Slot:     1
    :END:
**** scouts x7
     :PROPERTIES:
     :Cost:     91
     :END:
**** missile launcher
     :PROPERTIES:
     :Cost:     10
     :END:
**** Sergeant
     :PROPERTIES:
     :Cost:     10
     :END:
*** Sanguinary guard
    :PROPERTIES:
    :KP:       1
    :Scoring:  1
    :Slot:     1
    :END:
**** Guards x5
     :PROPERTIES:
     :Cost:     200
     :END:
**** Inferno pistols x3
     :PROPERTIES:
     :Cost:     30
     :END:
**** masks x5
     :PROPERTIES:
     :Cost:     25
     :END:
*** Sanguinary guard
    :PROPERTIES:
    :KP:       1
    :Scoring:  1
    :Slot:     1
    :END:
**** Guards x5
     :PROPERTIES:
     :Cost:     200
     :END:
**** Chapter Banner
     :PROPERTIES:
     :Cost:     30
     :END:
**** Inferno pistols x3
     :PROPERTIES:
     :Cost:     30
     :END:
** FastAttack
** HeavySupport
*** StormRaven
    :PROPERTIES:
    :KP:       1
    :Slot:     1
    :END:
**** StormRaven
     :PROPERTIES:
     :Cost:     200
     :END:
**** Extra Armour
     :PROPERTIES:
     :Cost:     15
     :END:
**** Locator Beacon
     :PROPERTIES:
     :Cost:     10
     :END:
**** TwinAssoult
**** TwinMMelta
*** Dreadnought
    :PROPERTIES:
    :KP:       1
    :Slot:     1
    :END:
**** Dreadnought
     :PROPERTIES:
     :Cost:     105
     :END:
**** Assault Canon
     :PROPERTIES:
     :Cost:     10
     :END:

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: column view extension
  2012-01-16 21:00 column view extension ayvango
@ 2012-01-17  8:50 ` Eric S Fraga
  2012-01-17 19:33 ` Michael Brand
  1 sibling, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2012-01-17  8:50 UTC (permalink / raw)
  To: ayvango; +Cc: emacs-orgmode

ayvango <ayvango@zoho.com> writes:

> I've found a non-standard use case for org-mode.

I don't think there is a *standard* use case for org!  ;-)

> There is plenty of spreadsheets engine with common drawback:
> spreadsheet cells follow original memory cell abstraction that are
> handy for a computer but is inconvenient for human. Hierarchical
> structures is more natural and in some cases may be used much more
> effective for at almost half of the data models.

Indeed.  And I like your particular example.  Enjoy!

> This method saves me a lot of time but it may not be used with other
> hierarchical data models as simply as for the army list. This models
> may require more complicated summary types than those provided from
> ground. Is there any way to incorporate abstract grammar for defining
> and processing properties. There is already a way to define
> synthesized attributes as well as inherited ones. But there is no way
> to bind them together with a function to calculate output.

I cannot answer this, whether any such way exists or not, but I can add
my +1 if what you want is not possible.


-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.8.03 (release_7.8.03.138.gbf1d5)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: column view extension
  2012-01-16 21:00 column view extension ayvango
  2012-01-17  8:50 ` Eric S Fraga
@ 2012-01-17 19:33 ` Michael Brand
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Brand @ 2012-01-17 19:33 UTC (permalink / raw)
  To: ayvango; +Cc: emacs-orgmode

Hi ayvango

On Mon, Jan 16, 2012 at 22:00, ayvango <ayvango@zoho.com> wrote:
> I hope someone become interested in creating spreadtree application
> based on existing properties code.

This would be very useful for me too. There are several resources that
go towards this direction:

*formulas in colum spec #+COLUMNS*

First of course average/sum/min/max/... in the manual and talks, see
the links in
http://thread.gmane.org/gmane.emacs.orgmode/42071/focus=42088
but then there is also this very interesting whole thread about
org-columns-compute and org-columns-compile-map
http://thread.gmane.org/gmane.emacs.orgmode/12067

*org-collector*

See e. g.
http://thread.gmane.org/gmane.emacs.orgmode/42071/focus=42091

*dynamic block columnview with #+TBLFM:*

For an example see indent2_tbl4.org.txt attached here
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00072.html
and for some issues see the whole thread here
http://thread.gmane.org/gmane.emacs.orgmode/48764

*remote() in #+TBLFM:*

A simple example that might be interesting for some special cases but
commonly quite inconvenient to change:
#+BEGIN_SRC org
  , #+STARTUP: odd
  , - hours are edited, the rest is calculated with
  ,   M-x org-table-iterate-buffer-tables
  , * parent
  ,   #+TBLNAME: parent
  ,   | days |
  ,   |    3 |
  ,   #+TBLFM: @>$1 = remote(child1, @>$1) + remote(child2, @>$1)
  , *** child1
  ,     #+TBLNAME: child1
  ,     | days | hours |   relative |
  ,     |    1 |     8 | 0.33333333 |
  ,     #+TBLFM: @>$1 = $2 / 8 :: @>$3 = $1 / remote(parent, @>$1)
  , *** child2
  ,     #+TBLNAME: child2
  ,     | days | hours |   relative |
  ,     |    2 |    16 | 0.66666667 |
  ,     #+TBLFM: @>$1 = $2 / 8 :: @>$3 = $1 / remote(parent, @>$1)
#+END_SRC

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-17 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 21:00 column view extension ayvango
2012-01-17  8:50 ` Eric S Fraga
2012-01-17 19:33 ` Michael Brand

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.