1.18. SVG gradient-radioactivity

发布时间 :2023-12-11 23:00:02 UTC      

1.18.1. SVG radioactive gradient- <radialGradient>

<radialGradient> elements are used to define radioactive gradients.

<radialGradient> labels must be nested in the <defs> on the inside. <defs> tag is an acronym for definitions that defines special elementssuch as gradients.

1.18.2. Example 1

Define a radioactive gradient from white to blue ellipse:

Here is the SVG code:

Example

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <radialGradient id="grad1" cx="50%" cy="50%" r="50%" fx="50%"
fy="50%">
      <stop offset="0%" style="stop-color:rgb(255,255,255);
      stop-opacity:0" />
      <stop offset="100%" style="stop-color:rgb(0,0,255);stop-opacity:1"
/>
    </radialGradient>
  </defs>
  <ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)" />
</svg>

Code parsing:

  • <radialGradient> id attribute of the tag defines a unique name for the gradient

  • Outermost circle defined by CX,CY and r attributes and innermost circle defined by Fx and Fy

  • The gradient color range can consist of two or more colors. Use one for eachcolor <stop> label assignment. offset property is used to define the start and end of a gradient

  • Populate the attribute to ellipse elements are linked to this gradient

1.18.3. Example 2

Another ellipse that defines the radioactive gradient from white to blue:

Here is the SVG code:

Example

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  <defs>
    <radialGradient id="grad1" cx="20%" cy="30%" r="30%" fx="50%"
fy="50%">
      <stop offset="0%" style="stop-color:rgb(255,255,255);
      stop-opacity:0" />
      <stop offset="100%" style="stop-color:rgb(0,0,255);stop-opacity:1"
/>
    </radialGradient>
  </defs>
  <ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)" />
</svg>

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.