Embedded SVG in a page

I am working on using SVG in a Notes db application. I am part of the way there, but I am attempting to use the shared file resource of ND6. In the following code, I have added comments for the objects that work or in other words can find and run the SVG file. I don’t seem to have found the correct syntax for accessing the file from the Domino shared file resource, or I don’t have the MIME type (currently Read Only and MIME type = image) set correctly or something else.

SVG Demonstration

SVG Demonstration

A page may have other code besides the SVG image.

Using objects allows the browser to decide what to display.

Any ideas?

Thanks

Tim

Subject: Embedded SVG in a page

Try to make a Frame with URL content.

Frame @formula Something like: ________________________

srv_name:=@ServerName;

ip:=@DbLookup(“Notes”:“NoCache”;“”:“names.nsf”;“Connections”;

@Name([Abbreviate]; srv_name):@Name([CN];@Name([Abbreviate]; srv_name));

“OptionalNetworkAddress”);

@Text(“http://” + @Text(ip) + “/containers.nsf/NumberedReleasesTrackReportAgent”)

Agent: ______________________________________________

Sub Initialize

'image/svg+xml

'srv_name:=@ServerName;

'ip:=@DbLookup(“Notes”:“NoCache”;“”:“names.nsf”;“Connections”;

'@Name([Abbreviate]; srv_name):@Name([CN];@Name([Abbreviate]; srv_name));

'“OptionalNetworkAddress”);

'@Text(“http://” + @Text(ip) + “/containers.nsf/NumberedReleasesTrackReportAgent”)

On Error Goto ErrorHandler



Dim s As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim view As NotesView

Dim vTemp As Variant

Dim iCount As Integer



Set db = s.currentDatabase

Set view = db.GetView( "Reports\Releases\Counts" )









Print "Content-type: image/svg+xml"

'Print "Content-type: text"



' === TOP ===	

Print |
<?xml version="1.0" standalone="no"?>
<desc> </desc>

<defs>

	<linearGradient id="BlueBarGradient" gradientUnits="objectBoundingBox">

		<stop offset="0%" stop-color="lightseagreen" />

		<stop offset="33%" stop-color="ghostwhite" />

		<stop offset="100%" stop-color="lightseagreen" />

	</linearGradient>



	<filter id="BarShadowFilter" filterUnits="userSpaceOnUse" x="-0" y="-0.25" width="8" height="8">

		<feGaussianBlur in="SourceAlpha" stdDeviation="0.0125" result="blur"/>

		<feOffset in="blur" dx="0.03" dy="-0.03" result="offsetBlur"/>

		<feMerge>

			<feMergeNode in="offsetBlur"/>

			<feMergeNode in="SourceGraphic"/>

		</feMerge>

	</filter>



	<filter id="AllShadowFilter" filterUnits="userSpaceOnUse" x="-0" y="-0.25" width="8" height="8">

		<feGaussianBlur in="SourceAlpha" stdDeviation="0.01" result="blur"/>

		<feOffset in="blur" dx="0.015" dy="0.015" result="offsetBlur"/>

		<feMerge>

			<feMergeNode in="offsetBlur"/>

			<feMergeNode in="SourceGraphic"/>

		</feMerge>

	</filter>

</defs>
<text x="4" y="0.07" style="text-anchor:middle;">Динамика количества</text>

<text x="4" y="0.30" style="text-anchor:middle;">зарегистрированных релизов.</text>

<text x="4" y="0.60" style="font-size:.2; text-anchor:middle;">(за последние 6 полных месяцев, выборка по дате релиза)</text>



<g filter="url(#AllShadowFilter)">



	<rect x="0.9" y="0.9" width="6.2" height="5.2" fill="ghostwhite" stroke="darkcyan" stroke-width=".01" />



	<g transform="translate(0.5 0.5)" style="text-anchor:middle;">		

|

’ Абсолютно бесполезный график, не выявляющий ни какие аспекты, используется в качестве демонстрации

’ Print |50|

’ Print |50|

vTemp = Evaluate(|@Implode(

“<text x='”+

“1”:“2”:“3”:“4”:“5”:“6”+“’ y=‘6’>”+

@Subset(@Subset(

@Text(@DbColumn("Notes":"NoCache";"":"";"Reports\\Releases\\Counts";2))

;-8);6)+“”

;@NewLine)

|)

Print Join( vTemp )









' === MIDDLE ===

Print |

	</g>



	<g transform="translate(0.5 0.75)" style="font-size:.2;">

|



'Print |<text x="0" y="0" transform="translate(1 6) skewY(10) rotate(30)">лдывпр вап ыв</text>|

'Print |<text x="0" y="0" transform="translate(2 6) skewY(10) rotate(30)">ывп ывп щывпр</text>|

’ iCount = 1

’ Set doc = view.GetFirstDocument

’ While Not(doc Is Nothing)

’ Print || + doc.ColumnValues(0) + ||

’ 'Call doc.PutInFolder(“Midnight Madness”)

’ Set doc = view.GetNextDocument(doc)

’ iCount = iCount + 1

’ Wend

vTemp = Evaluate(|@Implode(

“<text x=‘0’ y=‘0’ transform='translate(”+

“1”:“2”:“3”:“4”:“5”:“6”+" 6) skewY(10) rotate(30)'>"+

@Subset(@Subset(

@Text(@DbColumn("Notes":"NoCache";"":"";"Reports\\Releases\\Counts";1)) : "Total"

;-8);6)+“”

;@NewLine)

|)

Print Join( vTemp )











' === BOTTOM ===

Print |		</g>



</g>





<g filter="url(#BarShadowFilter)" fill="url(#BlueBarGradient)" transform="translate(0.25) scale(-1 1) rotate(180) translate( 0, -7)">





|

vTemp = Evaluate(|@Implode(

"<rect x='" + "1":"2":"3":"4":"5":"6"+"' y='1' width='0.5' height='"+

@ReplaceSubString(@Text(@TextToNumber(@Subset(@Subset(

@Text(@DbColumn("Notes":"NoCache";"":"";"Reports\\Releases\\Counts";2))

;-8);6))/30);“,”;“.”)

  • “’ stroke=‘lightseagreen’ stroke-width=‘.01’/>”

;@NewLine)

|)



Print Join( vTemp )













Print |	</g>
|









Exit Sub

ErrorHandler:

Print "NumberedReleasesTrackReportAgent ошибка выполнения агента по построению отчета: " & Str(Err) & " - " & Error$ & " на строке: " & Erl() & " пожалуйста сообщите разработчику."

Resume Next

End Sub

Subject: Embedded SVG in a page

The MIME type needs to be image/svg+xml or the browser will reject the file (it won’t match the accept-type of the request). And the only good way to link to the resource is:

data=“//test.svg”

where the computed text is @WebDbName.