Re: bug in ext_attributes or my xml file?



I think I just figured it out. The way copy / paste works with instances leads to this behavior. When you drag a new instance from the shape library creates the new memory. However if you select / paste it seems to be copying references to the data which accidentally glues them together. If you save the file and then reload it the instances become separate so this is obviously a bug. I can go in and fix this if it hasn't been fixed already.

-regards,
-avi



On Tue, Jun 17, 2008 at 9:09 AM, Avijit Ghosh <bloosqr gmail com> wrote:

Incidentally for what it does dia does really well. In fact I've been using it for a few years now for generating biological diagrams. Currently we've been looking into the possibility of adding a custom coded shape library for biological use (with python based code to connect to pubmed and what have you). That said there doesn't seem to be much in the way of documentation / tutorial with regards to creating custom shapes (programmable with custom connectors) that I can find. If there is one somewhere I would certainly appreciate it.

One simple extension has been to use the ext_attribute tag on the simple xml files .. however it looks like the ext_attribute ties all of the same shape together. That is once I modify an ext_attribute of one instance of that shape all of the shapes have the same value.

What is somewhat odd is this does not happen with the circuit example. I am going to try and figure out why myself but here is a copy of one of the .shape files

basically if I double click and change the species string it changes all of them rather than simply that one.

<?xml version="1.0"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns" xmlns:svg="http://www.w3.org/2000/svg">
  <name>Biodata - Metabolite</name>
  <description>Metabolite</description>
  <icon>metabolite.png</icon>
  <connections>
    <point x="0" y="5"/>
    <point x="1.4645" y="1.4645"/>
    <point x="5" y="0"/>
    <point x="8.5355" y="1.4645"/>
    <point x="10" y="5"/>
    <point x="8.5355" y="8.5355"/>
    <point x="5" y="10"/>
    <point x="1.4645" y="8.5355"/>
    <point x="5" y="6" main="yes"/>
  </connections>
  <ext_attributes>
        <ext_attribute name="species" description="Species(s)" type="string"/>
        <ext_attribute name="organ" description="Organ(s)" type="string"/>
        <ext_attribute name="organelle" description="Organelle(s)" type="string"/>
        <ext_attribute name="citationlist" description="Citation List" type="string"/>
  </ext_attributes>
  <textbox x1="1.4645" y1="1.4645" x2="8.5355" y2="8.5355"/>
  <svg:svg width="10" height="12">
    <svg:circle cx="5" cy="5" r="5" style="fill: default"/>
  </svg:svg>
</shape>


-regards,
-avi






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]