<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 1024 1024">
<style>
</style>
<image xlink:href="file:///D:/00/1fkitcity/stormsmuth/mapcityL301.png" x="0" y="0" height="100%" width="100%"/>
<text class="maptextlrg2" x="920" y="80" style="text-anchor: middle;">COASTAL</text>
<text class="maptextlrg2" x="920" y="110" style="text-anchor: middle;">REGION</text>
</svg>
I went onto the unofficial Discord and harassed @Pmario there 😅, and I think we've identified the cause of the problem.
The SVG uses interactivity defined in a way that is considered "unsecure" by many websites,
I am really intrigued by the idea of overlaying the SVG on top of the JPEG, but I am confused: would they scale properly? Both with the window, and with each other.
I did remove the JPEG and the svg is still 600k. I have ideas to reduce this size drastically.I need to make more tests.
Hello PMarioI did remove the JPEG and the svg is still 600k. I have ideas to reduce this size drastically.I need to make more tests.I just remembered about vector editor bloat-- so I think I know how you're going to trim it down : D
But here it seems to be from converting Text -> Paths
TW stylesheets
.zone:hover {
opacity:1
transition: 1s
}
<g class="zone" id="Old_Svalich_Road" inkscape:label="Old Svalich Road" style="fill:none"> <path sodipodi:nodetypes="aaaaaaaaaa" inkscape:connector-curvature="0" id="path5219" d="m 733.2591,459.98363 c 1.88541,-1.22344 4.48191,[etc, etc, etc]" style="fill:none" /> <path sodipodi:nodetypes="aaaaaaaaaaaaaaa" inkscape:connector-curvature="0" id="path5221" d="m 686.85224,478.31327 c 1.40937,[etc, etc, etc]" style="fill:none" /> </g>
Yes, that was deliberate on my part. When I originally had it as text, when I went to click on an object, I kept highlighting the text instead of activating the hyperlink, which is what I was intending to do. So, I converted the text to paths, so that I could still read the labels, but go straight into the area, rather than accidentally highlighting the text when I click on it.
I'm not sure how this is different/similar to regular CSS, since I don't even know anything about CSS anyway >_<
Can you guys also point me in the direction of resources I could read to try and get this done for myself? Pmario is super busy with his own projects, and I don't wanna bother him too much, but I do wanna be working on this as I can.
It seems that, right now, the main problem is that I can't get TW to reference the image in a format that works. Even if I change the content type to `svg` and copy-paste the contents in, it still nests it within an img tag, which kills all interactivity, regardless of whether it's defined in a stylesheet or using Inkscape's funky method.Do you know a way of inserting images that uses the svg or object tags, rather than the img tag?
what I have found so far...One way to get around the <img> tag
Import your svg-- you will get a tiddler of it that uses the <img> tag. Open it to edit it, click anywhere in the text field so the tile bar isn't high lighted, press Control A to select all, then Control V to copy. Close the tiddler. Create a new tiddler, paste what you copied into, give it a title anI'd close out of edit mode by clicking the tiddler's checkmark (upper right corner). Don't worry about setting a type-- it will display the svg. You can deleted the impoerted tiddler.
I've made some progress, but GG keeps deleting my message, so I can't detail or show evidence of what I've done. Not sure what's going on, this is the third time I've typed this out.
Interactivity is working. I can't show you what I did to make it work, because GG will just delete it again, but it's working, using a stylesheet.
- Whenever I hover over the area, the text path--and only the text path-- shifts in position a little, despite that behavior not being defined anywhere in the SVG or the stylesheet.
- The text file is still super bloated, so it's a huge pain to edit, but I have no idea what is or is not safe to delete.
- There's no background picture, just the zones, which makes things a little difficult, since that was the entire purpose of getting these images together. I'd love to define the jpg (which I've uploaded to the wiki) as the background image for the svg, but I don't know how to do that, and because the text is so bloated, I can't tinker around to find what works.
- The image was scaled improperly, and I had to manually edit the height down to get rid of a strange layer of upper padding. No idea why Inkscape would mess it up so much, but it did, and that suggest to me that perhaps the jpeg background wouldn't scale properly either
<g><a href="#Van_Richten_Tower"> <path class="hoverz1" style="stroke:none;stroke-width:0.06992456px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="m 476.58257,404.90664 c 0.97519,1.93218 2.57802,3.7967 4.59124,4.59124 2.60767,1.02916 5.69433,0.4307
8.4055,-0.28254 3.54424,-0.93239 8.40814,-1.67438 9.74756,-5.08568 1.23293,-3.14011 -1.31075,-6.87948
-3.39046,-9.53565 -1.94848,-2.48857 -4.78182,-4.78269 -7.91106,-5.22696 -2.58795,-0.36741 -5.35419,0.82014
-7.48726,2.33094 -2.25185,1.59494 -4.27418,3.9628 -4.94441,6.63964 -0.53782,2.14804 -0.009,4.59218
0.98889,6.56901 z" id="Van_Richten_Tower" inkscape:connector-curvature="0" sodipodi:nodetypes="aaaaaaaaa" inkscape:label="Van Richten's Tower" /><title>Van Richten Tower</title></a></g>
the <g></g> is for the tooltip -- the <title> if you want tooltips with your mouse over.
If thats something you wouldn't want, remove <g>
<title>Van Richten Tower</title></g>
the<a href="#Van_Richten_Tower">
</a> is for links to tiddlers-- all you need is #tiddlername
if used in a svg tiddler
the class name "hoverz1" is for mouse over-- in CSS you use hover for styling
normally you also define the normal (non hover) state along with the hover in the style section
but for some reason I didn't have to with your example file.
<style>.hoverz1:hover {fill:white;}</style>
<-- put before <defs> at top of file -->
Important thing is you have to remove any matching styling on the elements that you define
in the style section-- I had to take the opacity and fill-opacity off of each element I geve the hover
effect class to.
Also if you want the hover effect to work indeprndently for each hover zone, they get the class not a group--
if the group gets it then each hover zone of that group will cause the rest of the group also to high light.
So grouping a hover zone with its text as a pair and giveing their group the class would eork-- experimenting
will show you what works. Though with a file this large you're probably getting typing lag if you have the
editor preview window open. If your file length is causing your preview window to disappear off screen, set
the editor window size to 600 in the editoe toolbar.
.image {
max-width: 100%;
}
.hover {
opacity: .4 !important;
transition: .1s ease
}
.hover:hover {
opacity: 1 !important;
}
.circle {
opacity: .70 !important;
fill-opacity: .70 !important;
}
.text{
fill: #fff;
stroke-width: 0.1;
stroke: #000;
}
.red{
fill: #800000;
}
.blue{
fill: #008080;
}
.green{
fill: #008000;
}
.dark-blue{
fill: #0e0e72;
}
.purple{
fill: #800080;
}
.yellow{
fill: #808000;
}
Is there a way to tie the background and svg together, so that if I change the viewbox (which I'm assuming is the best way to accomplish what I'm looking for), the areas would still be lined up?
So, this is one of the final maps I have. Interactivity is great, background image is great (the other maps use image, rather than background-image in the style), the links are all working perfectly, I've got a unified style set up for text.
But the problem is: I keep getting this weird, jiggly effect on certain items of text. Large text items don't have it, but smaller text items do. One thing I did notice, when I took an image that had jiggly text, then changed the width, height, and viewbox to "zoom in" on an area, the jiggling actually stopped, even though the code for that area specifically was identical. So, does that mean it would be a rendering error?
jiggly as in an actual contast "motion" jiggle (like an animation motion)-- probably is a randering issue then if it does it independently of any interaction
Well, it only happens when I hover over the object. And it's less of a jiggle, and more "when highlighted, text moves 6 pixels to the left and 3 pixels up" and "on mouseoff, text moves back to original position." I have no idea what causes it, or why it happens for certain text objects, but not for others. The code for the two areas is identical, with the exception of the path.
ANSWER: When you're editing a Tiddler, edit the 'Type' from image/svg+xml to application/x-tiddler. Copy and paste your svg code into the box. You can clean up your code here. Don't embed your background image, reference it using CSS-- style="background-image: url('fil:///./images/worldmap etc--.TiddleWiki seems like the ideal format for organizing my D&D notes, as recommended by a couple of friends. Additionally, I tend to use .svg's for world maps, with interactive behavior added in that allows me to 'click' on a region, and go to that page.Currently, I have an svg map set up, but I'm having enormous difficulty inserting it into TiddlyWiki, because the file is enormous (for an svg), so when I open up notepad, and copy-paste the text into the box for the new Tiddle, my whole computer lags, trying to manager that enormous amount of text in my clip tray. I haven't found a way to upload the image file directly into the tiddle, when I click and drag it into explorer, the following happens:Whenever I open the svg in a browser, or insert it accidentally using the process I showed above, the image behaves as desired, with areas highlighting when my mouse hovers over them and allowing me to click them to travel to links (I cut out those parts while I create the rest of my wiki).However, the image obviously does not scale, and I'm not sure that it would link to other Tiddles if I were try and use it in this fashion.When I use the method described in the second paragraph, where I copy and paste the text contents of the svg into a tiddle (which is enormously tedious), the image inserts correctly, and it scales to fit the window, but the image's interactivity is totally absent:So I guess my questions are as follows:
- How do I insert svg images into a locally hosted Wiki, without having to deal with the hassle of copying and pasting everything over?
- How do I restore the interactive functionality of the svg, so that these areas highlight and fade when the mouse hovers over them?
Also, this is kind of a sub question, but how do I insert those links into images when I'm hosting locally? I obviously can't link to a website, since the files are hosted on my computer, but how do I link them? (This is probably explained somewhere else, just figured I should ask while I'm here.)
toc-tabbed-internal-nav and toc-tabbed-external-nav seem to do this really interesting behavior, where it has the table of contents in a fixed position, but open the page in another window.I was wondering if there was some way to accomplish a similar effect, but with the 'toc' being an image.
My ideal situation is that I have a 'map of the floor' on the left hand side, and then the page that I click on opens in the right tab, while still being able to view the map on the left. But, when I click a specific hyperlink, either in the text or in the svg image, then I "go to the next floor", and the svg image changes, allowing me to access a different set of "rooms" (ie tiddlers).
On the left hand side (or right, it doesn't particularly matter), there'd be a 'map tab' or 'map window', showing a map of the current area. I'd be able to click on hyperlinks within the map to open up specific Tiddlers for each 'sub area,' with those tiddlers appearing on the other side, so that I can view the map and the notes at the same time.
Certain hyperlinks, as specified by me, will have new maps available to them, and when I click on them, the image in the 'map tab' will change (and it'd be nice if all the tiddlers in the notes half disappeared as well, but that's not super critical).
Then it will behave as before, where I can click on sub regions, which open up notes in another tab so that I can view them side by side. Then, clicking another 'region' hyperlink will change the maps+notes again.