Building Responsive Data Visualization for the Web. Bill Hinderman
Чтение книги онлайн.

Читать онлайн книгу Building Responsive Data Visualization for the Web - Bill Hinderman страница 7

Название: Building Responsive Data Visualization for the Web

Автор: Bill Hinderman

Издательство: John Wiley & Sons Limited

Жанр: Программирование

Серия:

isbn: 9781119067207

isbn:

СКАЧАТЬ style="font-size:15px;">      Using Google’s PageSpeed, you can dynamically replace the image’s source with a resized version, as referenced in the code below.

You’ll notice in Figures 2-1 and 2-2 that the image is exactly the same, but Figure 2-1 is much larger in both actual size and file size. If you were actually trying to show a giant image next to a small one, this would be what you want. However, when working on a responsive design, your media will most often be some fluid size that takes up a percentage of the device’s screen. As such, the two images would be displayed at the same size while being downloaded at the two very different resolutions.

Figure 2-1: Without RESS to handle image size, this image is massive.

Figure 2-2: With RESS, you can cut the image’s payload by sending a smaller size from the server.

      This same technique can be used to send different CSS, JavaScript, or even direct users to entirely different versions of the page.

      RESS is a powerful technique to eliminate bloat, but there is really no reason for it to be confused with adaptive web design. It’s simply another tool in your arsenal.

Limiting Your Adaptive Design Definition

      Just as “adaptive web design” can be misused in the broadest sense, it can also be misused as very specific concepts. Again, all of these concepts are part of a greater web optimization scheme which we call adaptive web design.

      Think of the limited adaptive design definition as a clunky way of trying to optimize for specific devices. Your goal should be to make something work for not just the screens you recognize and regularly use, but for those that you have never seen, and even those that haven’t yet been invented. Therefore, I’m presenting the following two ideas: device detection and adaptive layouts, only because they will come up in Chapters 3, 4, and 5. This is not an endorsement of either technique.

Device Detection

      Device detection, typically transmitted through the device’s user agent string, is exactly what it sounds like: the process of determining an individual type of device and what features it has. While it sounds tempting to start designing by building for an individual device, you then have to build separately for every other device as well.

      This concept is usefully abstracted with tools like Modernizr, or methods of RESS, by grouping devices into classes that fit into either a yes or a no category for individual features.

      Конец ознакомительного фрагмента.

      Текст предоставлен ООО «ЛитРес».

      Прочитайте эту книгу целиком, купив полную легальную версию на ЛитРес.

      Безопасно оплатить книгу можно банковской картой Visa, MasterCard, Maestro, со счета мобильного телефона, с платежного терминала, в салоне МТС или Связной, через PayPal, WebMoney, Яндекс.Деньги, QIWI Кошелек, бонусными картами или другим удобным Вам способом.

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAQCAwMDAgQDAwMEBAQEBQkGBQUFBQsICAYJDQsNDQ0LDAwOEBQRDg8TDwwMEhgSExUWFxcXDhEZGxkWGhQWFxb/2wBDAQQEBAUFBQoGBgoWDwwPFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhb/wAARCAHVAu4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAg
СКАЧАТЬ