Function: chart-translate-namezone

chart-translate-namezone is a byte-compiled function defined in chart.el.gz.

Signature

(chart-translate-namezone ARG &rest ARGS)

Implementations

(chart-translate-namezone (C chart) N) in `chart.el'.

Return a dot-pair representing a positional range for a name. The name in chart C of the Nth name resides. Automatically compensates for direction.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/chart.el.gz
(cl-defmethod chart-translate-namezone ((c chart) n)
  "Return a dot-pair representing a positional range for a name.
The name in chart C of the Nth name resides.
Automatically compensates for direction."
  (let* ((dir (oref c direction))
	 (w (if (eq dir 'vertical) (oref c x-width) (oref c y-width)))
	 (m (if (eq dir 'vertical) (oref c y-margin) (oref c x-margin)))
	 (ns (length
	      (oref (if (eq dir 'vertical) (oref c x-axis) (oref c y-axis))
		    items)))
	 (lpn (/ (+ 1.0 (float w)) (float ns)))
	 )
    (cons (+ m (round (* lpn (float n))))
	  (+ m -1 (round (* lpn (+ 1.0 (float n))))))
    ))