| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/inkscape/extensions/__pycache__/ |
Upload File : |
o
0�aBT � @ s� d dl Z d dlZd dlZd dlmZ d dlZd dlmZ d dlmZm Z m
Z
mZ d dlm
Z
mZ g d�g d�g d�g d �g d
�d�ZG dd
� d
ej�ZedkrVe� �� dS dS )� N)�ArgumentTypeError)�filename_arg)�Filter�TextElement�Circle� Rectangle)�Move�line)z#460101z#980101z#d40000z#f44800z#fb8b00z#eec73ez#d9bb7az#fdd99b)z#000442z#0F1781z#252FB7z#3A45E1z#656DDEz#8A91EC)z#222222z#444444z#666666z#888888z#aaaaaaz#ccccccz#eeeeee)z#0000FFz#FF0000z#00FF00z#CF9100z#FF00FFz#00FFFF)z#f8d753z#5c9746z#3e75a7z#7a653ez#e1662az#74796fz#c4384fz#fff8a3z#a9cc8fz#b2c8d9z#bea37az#f3aa79z#b5b5a9z#e6a5a5)�red�blue�gray�contrast�sapc @ s� e Zd ZdZdZedd� �Zdd� Zdd� Zd d
� Z dd� Z
d
d� Zdd� Zdd� Z
dd� Zd!dd�Zdd� Zd"dd�Zdd� Zd S )#� NiceChartz�
Inkscape extension that can draw pie charts and bar charts
(stacked, single, horizontally or vertically)
with optional drop shadow, from a csv file or from pasted text
Tc C s d� | jj�S )zLayer title/labelzChart-Layer: {})�format�options�what)�self� r �+/usr/share/inkscape/extensions/nicechart.py�container_labelL s zNiceChart.container_labelc C s |� d� |j ddd� |j ddddd � |j d
d| �d�| jd
d� |j ddtjddd� |j ddtdd� |j dddd
d � |j ddddd � |j ddd d!d � |j d"d#d$� |j d%tjd&d'd� |j d(d)td*d+d� |j d,d-td.d/d� |j d0tjdd1d� |j d2d3tjd&d4d� |j d5d6td7d8d� |j d9d:td;d<d� |j d=d>td;d?d� |j d@dAtdBdCd� |j dDtdEdF� |j dGdHtdBdId� |j dJtdKdLd� |j dMtjd&dNd� |j dOdPdQdRd � |j dSdTtd7dUd� |j dVdWdXdYd � |j dZd[tjd&d\d� d S )]Nz--tabz
--encodingzutf-8)�defaultz-wz--whatz22,11,67zChart Values)r �helpz-tz--type�renderz
Chart Type)�typer r z-bz--blurTz Blur Typez-fz
--filenamezName of File)r r z-iz--input_type�filez-dz--delimiter�;� delimiterz-cz--colorsr zcolor-schemez--colors_overridezcolor-scheme-override)r z--reverse_colorsFzreverse color-schemez-kz --col_keyr zcolumn that contains the keysz-vz --col_val� zcolumn that contains the valuesz
--headingsz?first line of the CSV file consists of headings for the columnsz-rz--rotatezDraw barchart horizontallyz-Wz--bar-width�
z
width of barsz-pz--pie-radius�d zradius of pie-chartsz-Hz--bar-heightzheight of barsz-Oz--bar-offset� zdistance between barsz--stroke-widthg �?)r r z-oz
--text-offsetz%distance between bar and descriptionsz--heading-offset�2 z&distance between chart and chart titlez--segment-overlapz=Remove aliasing effects by letting pie chart segments overlapz-Fz--fontz
sans-serifzfont of descriptionz-Sz--font-sizezfont size of descriptionz-Cz--font-color�blackzfont color of descriptionz-Vz
--show_valueszShow values in chart)�add_argument�
arg_method�
render_bar�inkex�Booleanr �int�float)r �parsr r r �
add_argumentsQ sb
�������
���
�zNiceChart.add_argumentsc s | j j� | j j�dd� �| j jdkr`| j jdu rt�d��t| j jd��3}tj || j j
d�}�}| j jr<t|�}|� }� ��fdd �|D �}|ft
t|� � W d � S 1 sZw Y n"| j jd
kr�tdd � | j j�d�D �� \}}d
|�fdd �|D �fS t�d��)zProcess the datac S s t | �} | dk r
t�d��| S )z'Confirm the values from files or directr z,Negative values are currently not supported!)r* r'