I have a SVG doc in the order of 100Ks. This doc contains a map divided into about 100 sectors, and I shade each of these sectors to represent a certain statistic. To do this shading I decided to create a javascript array - as I could then use some javascript to set the colors at run time instead of hard coding all the colors using the styling tags. The reason I did this was because I thought it would be easier from a perl perspective. Now when I wish to present a statistic to the client, I can open up my server side generic svg doc, fill in the array with the desired colors, and spit the result to the client. Does that sound daft?
Anyway I've placed this empty array (colors1) near the start of my svg doc - looking something like this -
<?xml version="1.0" standalone="no" ?>
<!-- Created by "Barry Griffin" -->
<!-- (C) Barry Griffin 2002 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg id="mainmap" xml:space="preserve" style="shape-rendering:geometri
+cPrecision; text-rendering:geometricPrecision;
image-rendering:optimizeQuality"
onload="init(evt)" width="800" height="420">
<script type="text/ecmascript"> <![CDATA[
var colors1 = [];
REST OF DOC...
So how should I go about filling this array using perl, and then send it to the client? Sorry for not presenting any perl - I have the color values stored in a @colorArray, after that I'm not sure how to tackle the problem, thanks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.