<!DOCTYPE rkplugin>
<document>
	<code file="piechart.php" />
	<help file="piechart.rkh" />
	<logic>
		<set id="plotoptions.allow_ylim" to="false"/>
		<set id="plotoptions.allow_xlim" to="false"/>
		<set id="plotoptions.allow_type" to="false"/>
		<set id="plotoptions.allow_log" to="false"/>
		
		<convert id="custom_names" mode="equals" sources="names_mode.string" standard="custom"/>
		<convert id="rexp_names" mode="equals" sources="names_mode.string" standard="rexp"/>
		<connect client="names_custom.visible" governor="rexp_names.not"/>
		<connect client="names_custom.enabled" governor="custom_names"/>
		<connect client="names_exp.visible" governor="rexp_names"/>
		<connect client="names_exp.required" governor="rexp_names"/>
		
		<convert id="density_0" mode="range" sources="density.real;density_inc.real" max="0"/>
		<connect client="angle.enabled" governor="density_0.not"/>
		<connect client="angle_inc.enabled" governor="density_0.not"/>
	</logic>
	<dialog label="Pie chart" >
		<tabbook>
			<tab label="Variables" id="tab_variables">
				<row>
					<varselector id="vars"/>
					<column>
						<varslot min_vars="1" id="x" source="vars" required="true" label="Variable"/>
						<checkbox id="tabulate" label="Tabulate" value="1" value_unchecked="0" checked="false" />
						<frame label="Labels">
							<radio id="names_mode" label="Labeling" >
								<option value="default" label="Default labels" checked="true"/>
								<option value="custom" label="Custom labels"/>
								<option value="rexp" label="From R expression"/>
							</radio>
							<input id="names_exp" label="Expression to use for labels" initial="names (x)"/>
							<input id="names_custom" label="Labels (separated by ';')" initial="First label;Second label"/>
						</frame>
						<stretch/>
						<preview id="preview"/>
					</column>
				</row>
			</tab>
			<tab label="Options" id="tab_options">
				<row>
					<radio id="colors" label="Colors" >
						<option value="default" label="Default (pastel)" checked="true"/>
						<option value="grayscale" label="Grayscale"/>
						<option value="rainbow" label="Rainbow colors"/>
					</radio>
					
				</row>
				<checkbox id="clockwise" label="clockwise" value="1" value_unchecked="0" checked="false" />
				<spinbox id="radius" type="real" min="0.01" max="1" initial="0.8" label="Radius"/>
				<frame label="Shading">
					<row>
						<spinbox id="density" type="real" min="-1" max="10000" initial="-1" label="density" default_precision="0"/>
						<spinbox id="density_inc" type="real" min="-10000" initial="0" max="10000" default_precision="0" label="increment in density"/>
					</row>
					<row>
						<spinbox id="angle" type="real" min="0" initial="45" max="360" label="angle" default_precision="0"/>
						<spinbox id="angle_inc" type="real" min="-360" initial="0" max="360" default_precision="0" label="increment in angle"/>
					</row>
				</frame>
				<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options"/>
			</tab>
		</tabbook>
	</dialog>
</document>
